|
-
Apr 10th, 2007, 02:01 PM
#1
Thread Starter
New Member
[RESOLVED] winsock problem
hi,
I have a server application that sends a number of strings to another via winsock.The client then seperates them depending on their identifier at the start of the string and places them to the apropriate textbox
Heres the code:
wschat.SendData ("u1" & Form1.username.Text)
wschat.SendData ("ph" & php.Text)
wschat.SendData ("tu" & k)
The problem is that allstrings arrive together...
For example their form is u1usernamephplayertu3
instead of u1username then phplayer and lastly tu3
Can you please help me?
-
Apr 10th, 2007, 02:45 PM
#2
Addicted Member
Re: winsock problem
i think u send too fast
wschat.SendData ("u1" & Form1.username.Text)
doevents
wschat.SendData ("ph" & php.Text)
doevents
wschat.SendData ("tu" & k)
or u can put something end of the each packet so u can split them
-
Apr 10th, 2007, 04:13 PM
#3
Re: winsock problem
I remember having this problem when I was kinda new to Winsock.
Separate each individual packet and split them up at the server, ie:
Code:
Socket.SendData "Packet 1" & vbCrlf
Socket.SendData "Packet 2" & vbCrlf
Then when they arrive you can use the Split() function to separate each packet.
They would look like this:
Packet 1
Packet 2
Of course you can use anything you want (not necessarily a vbCrLf) to separate the packets.
-
Apr 11th, 2007, 03:08 AM
#4
Thread Starter
New Member
Re: winsock problem
thanks for your replies,it solved the problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|