hello folks!
the question i have is not a typical “multiplayer networking” but “networking” one.
i hope somwebody can help me. i want to work with pysical interfaces that you can find on www.phidgets.com.
these interfaces are pretty cool because you can connect them directly to your mac via usb. they have crossplatform software that you can use. the driver has even a webservice that you can connect to.
now there’s my problem. the webservice sends data on port 5001 and i tested this with the terminal: “telnet localhost 5001” as a result i receive: “connected to localhost”. now i know that the service works.
now i tried the same with unity. i put the following code on a gameobject:
var port = 5001;
function OnMouseUp () {
ConnectToServer();
}
function ConnectToServer () {
Network.Connect(“127.0.0.1”, port);
}
function OnFailedToConnect(error: NetworkConnectionError) {
Debug.Log("Could not connect to server: "+ error);
}
unfortunately i get three error messages:
- “Running as a client. No player ID set yet.”
- “The connection request to 127.0.0.1:5001 failed. Are you sure the server can be connected to?”
- “Could not connect to server: ConnectionFailed”
it seems that i did not understand how the networking concept in unity works. would be nice if somebody could shed some light on this even if this is not a “multiplayer” issue.
thanx.chris