android - TCP sending with Unity -
I am quite new to Unity, but I have created an app that sends a simple TCP message to the click of a button A very simple TCP server console application. This code works perfectly when I run it on my PC, but when I make it for Android and test through my phone the message does not reach the server. Am I doing it wrong? Is ordinary TCP interaction done differently with Android? Here is my Integration Code:
Public Texture BTN Detection; Public GUIStyle style; TcpClient mySocket = New TcpClient (); Public Network Stream The Stream; Public string host = "my_ip_address"; Public Int32 port = 8888; Public sent Bull = false; Streamer; TheWriter; Streamer The Reader; Strange (ONGI) (if (GUI button (new rickety (screen. With / 2) - screen with / 4, (screen .4 / 2) - screen .4 / screen, with screen / 2, screen width / 2), BTN detection) {if (! Sent) {mySocket = new TcpClient (host, port); Thestream = mySocket.GetStream (); TheWriter = New Streamer (The Stream); TheReader = New Streamerdidder (The Stream); Sent = True;} TheWriter.Write ("TCP message" + "$"); theWriter.Flush (); // application. Load level ("Page 1");}}
The post you posted By looking at the date, it may be too late to answer. However, I was faced with some kind of familiar problem but with iOS. I hope it can be helpful for those who are following
I suggest digging in the library that you are using to connect to the TCP connection. For my problem, the reason parsing library TCP The parsing library is something that was not in iOS.
Comments
Post a Comment