|
-
Sep 18th, 2002, 06:22 PM
#1
Thread Starter
New Member
sockets & threads
I'm trying to write a multithreaded application where 1 thread monitors a queue and send the messages in the queue (if there are any) and 1 thread looks for incoming messages and handles them... The first part I have done and is working, the second part (incoming messages) I can't get to work.
Is there a sockets function that gets triggered or wait for incoming data? If not, do I just have to put a read in an endless loop or so?
Thanks,
Chig.
-
Sep 19th, 2002, 04:26 AM
#2
Addicted Member
You have to make your own procedure to check if there is incomming data.
I'm also creating a kind of messenger program and i'm using a timer.
First i use the Pending to check incomming connections.
Then i check incomming data for each connection.
Each active connection has an Sockets.Socket object to communicate with the clients.
After that is check for incomming data.
If Socket.GetStream.DataAvailable = True Then
While Socket.GetStream.DataAvailable
Socket.GetStream.Read(Buffer,0,Buffer.lenght)
End While
End if
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
|