|
-
Nov 7th, 2003, 08:30 AM
#1
Thread Starter
Member
Using the system.net.sockets
Hey all, I have a puzzling question I am hoping someone can answer. I have created two apps. A client app and server app. These applications send messages back and forth. When the client sends a message to the server, the server processes the message and then sends the message back to the client. Frequently, mupltiple messages may need to be sent back to the client from the server. The server sucessfully fires off these messages one by one, but they are then stored in the stream and when the client picks up the message, it picks up all of the messages out of the stream and puts them into one long string. I want to figure out how to somehow have the client pickup the message out of the stream process the message, then go back and get the next message out of the stream. Below is the client code which retreives the messages in the stream. Right now if the server sends multiple messages to the client the client will pick up anything the server has sent, not just the first message. Let me know what you think! Thanks in advance.
CLIENT CODE WHICH GETS THE MESSAGE SENT BY THE SERVER
While TransCompleteIn = "" Or TransCompleteIn = "1"
Dim bytes As Int64 = stream.Read(data, 0, data.Length)
responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes)
MsgBox(responseData.Length)
'Call A Parsing Function To Parse Out The Message String
Parser(responseData)
'Call a Message Processing Function to Process the Message
ProcessMsg()
responseData = ""
End While
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
|