0

Hiya all,

how do people send things over the winsock command.

Say that you have a server that does two task (A and B), and the client tells the server to do each one.

When I first started I tried sending an arrays and things like that, but could only send strings.

So now I prefix the text with a command ie

winsock.senddata "\A" or winsock.senddata "\B"

How do you do it. is there a better way of sending details through TCPIP?.

2
Contributors
1
Reply
4
Views
9 Years
Discussion Span
Last Post by Diguelo
0

A lot of code to and from a server can best be sent as a complex string with seperator characters. Personally I use CHR(255) for the end of the string send and CHR(254) as intermediate break points.

ie

dim datastream as string
datastream = "" ' I always do this it saves some querky prototyping errors ive been getting using SP6

datastream=datablock1 + chr(254) + datablock2 + chr(254) + .... + CHR(255)
winsock.senddata datastream

doing it this way your client program can easily be constructed to talk and listen to the server with ease. Ive done a lot of MUD coding and this is as efficient as Ive ever needed to be.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.