Comments (5)
private void SocketOpened(object sender, System.EventArgs e)
{
//invoke when socket opened
}
that all
from unitysocketio.
Same here :( sadly I got no solution for you so far.
from unitysocketio.
I found a solution now. Only the SocketMessage event uses the MessageEventArgs class. All other events expect the normal EventArgs class. Change your code to that and make sure to import the System namespace (using System). That should fix this error.
from unitysocketio.
i have same problem please help me
This id my code:
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
//using System.Threading.Tasks;
using System.Linq;
using System.Net;
using System.Threading;
using SocketIOClient.Eventing;
using SocketIOClient.Messages;
using WebSocket4Net;
using SocketIOClient;
public class soketIO : MonoBehaviour {
SocketIOClient.Client client = new SocketIOClient.Client("http://localhost:80/");
// Use this for initialization
void Start () {
client.Opened += SocketOpened;
client.Message += SocketMessage;
client.SocketConnectionClosed += SocketConnectionClosed;
client.Error +=SocketError;
client.Connect();
}
private void SocketOpened(object sender, SocketIOClient.MessageEventArgs e) {
//invoke when socket opened
print ("soket is opened");
}
void Update(){
if(Input.GetKeyDown("c")){
//client.Send(SocketIOClient.Messages.IMessage);
}
}
private void SocketMessage (object sender, SocketIOClient.MessageEventArgs e) {
if ( e!= null && e.Message.Event == "message") {
string msg = e.Message.MessageText;
process(msg);
}
}
I got these errors :
Assets/soketIO.cs(25,24): error CS0123: A method or delegate soketIO.SocketOpened(object, SocketIOClient.MessageEventArgs)' parameters do not match delegate
System.EventHandler(object, System.EventArgs)' parameters
#########################################
Assets/soketIO.cs(25,24): error CS0428: Cannot convert method group SocketOpened' to non-delegate type
System.EventHandler'. Consider using parentheses to invoke the method
#########################################
Assets/soketIO.cs(27,50): error CS0103: The name SocketConnectionClosed' does not exist in the current context ######################################## Assets/soketIO.cs(28,32): error CS0103: The name
SocketError' does not exist in the current context
########################################
Assets/soketIO.cs(51,25): error CS0103: The name `process' does not exist in the current context
from unitysocketio.
CapsE's Solution works for me.
from unitysocketio.
Related Issues (20)
- Emit fixed, but DLL's not updated HOT 2
- Fix example code for SocketOpened() HOT 1
- Error compiling HOT 2
- 8 hours straight trying to make the simplest thing work HOT 2
- Not working with new socket.io 1.0.4 server HOT 4
- Unity Web Player HOT 1
- 为什么不直接用socket,而是websocket呢? HOT 1
- Cross platform? HOT 2
- Not Compatible with Socket.io > v0.9 HOT 2
- Could I use for mobile HOT 4
- Complete incompatibility with new Socket.IO HOT 4
- Hi
- Server Part
- 项目没人维护了吗?
- Error initializing handshake with local url. HOT 11
- How do your set query in the socket parameter? HOT 1
- not compatible source code?
- Do you know any v3 or higher server?
- Socket connection issue in carrier network
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitysocketio.