I am trying to get c# tcp connection done. My plan is that each user connects via Unity and has than a c# tcp connection to the TcpListener on the server (for some heavy sending tasks). The problem is that the Client is unable to create a connection to TcpListern but is connected to unity server. The error is a Socketexception that says that i cant have multiple connections on the same IPEndPoint (IP, Port). The unity server is created with IP : 12345 (just for testing) and TcpListener with IP : 13345. I dont know why the client is unable to connect. The port shouldnt be blocked (used cmd netstat -a).
So is there anyone who could tell me, how to setup an additional connection via C# TcpClients / sockets? (i do want to have unity for the update and game logic)
and / or someone who has a better solution for sending big amounts of data async? (x * 5324 floats – x * 4 * float[11, 11, 11] as array)
i dont understand why are you using TCP for multiplayer networking, whe you could use Unity’s built networking? but trying to setup additional connections, its not what tcp was made for, it was for transmitting data as a game updater, but not a connector.
Wrong, he wants to send heavy custom data, no go with Unity’s networking.
Please only reply if you know what you are talking about, postings like this are verry annoying.
@apples yes, you are right. I couldnt have said it better ^^
I forgot to mention that i am currently testing this on localhost. I guess there is some problem with the Listener and the client on the same machine, or am I wrong? Saidly I havent had time to test this via Hamachi. My game only needs to run via Hamachi, so i dont care about NAT.
are you using the same socket for listening or do you create a new? because it could be possible that if you use IO::Socket::INET that you configured that only 1 socket can connect, I think this should be the Listen => 1 section. then you have to change this to an higher value. or do you use some unity3d sockets then I don’ t know how they set up their sockets.
please not that the information I just gave you is for perl but I think this should be in the other languages the same. I personally also program in c++ but it should be the same.