I have code from google for connecting max and socket serwer. This code can send message "hello world". I have question, how I can create function to receive strings from server. Problem is new Thread. When I try listen serwer, max has waiting, and I cant working.
I need try run my code in new Thread, I need help.
hejHo = dotNetObject "System.Net.Sockets.Socket" ( dotnetclass "System.Net.Sockets.AddressFamily" ).InterNetwork ( dotnetclass "System.Net.Sockets.SocketType" ).Stream ( dotnetclass "System.Net.Sockets.ProtocolType" ).Tcp hejHo.Connect "127.0.0.1" 8001 ascii_decoder = dotNetObject "System.Text.ASCIIEncoding" bytes = dotNetObject "System.Byte" 4096 result = hejHo.Receive bytes return_text = ascii_decoder.GetString(bytes)
My target is: my app sends and receive <------> socket serwer C# <------> max script
I need send commands to max script and run any script (.ms) from disk.
Sorry for my english.