|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/20/2007 6:21:39 AM
Posts: 2,
Visits: 8
|
|
can you please give me an example (script) for network communication via socket devices?
I successfully connected to a server but I can't send a string to the server by:
strData = "TEST"
MySocket.WriteString (strData)
Hello,
It seems that E-Prime sends continuously requests (without a command=strData) to my TCP-Server even without a WriteString - Command.
I guess that:
strData = "TEST"
MySocket.WriteString (strData)
should transfer the "TEST" string to the TCP server and afterwards the server sends the answer back to the client.
Now I can retrieve the information from the server by calling:
CountChar = MySocket.ReadString(ReceiveString)
Debug.Print "RECEIVED: " &ReceiveString
Is this proceeding correct?
Thanks in advance,
Johann Kim
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Today @ 8:53:29 AM
Posts: 577,
Visits: 1,255
|
|
| What you have setup is exactly how the socket device should be working especially if you can receive successfully. Things to try would be as follows... 1) Try calling SocketDevice.FlushInputBuffer and SocketDevice.FlushOutputBuffer prior to making your calls (where SocketDevice is the name of your socket device) 2) Try removing the ( ) parens from the WriteCalls. In E-Basic, methods that do not return values like the Write calls do not need the parens and in some cases will pass references instead of values. -Brandon
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/20/2007 6:21:39 AM
Posts: 2,
Visits: 8
|
|
Thank you very much for your answer, we will try it out,
best, Johann
|
|
|
|