[C#] raise event at incomming connection?

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

[C#] raise event at incomming connection?

Post by King Harold »

this Socket.listen works, but it also locks up - completely.
is there any way to make something raise an event that would come when 'listen' would have ended?
(probably, but how?)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

It sounds like you need to implement an asynchronous client/server design rather than a synchronous one.

Socket Code Examples.
...The client is built with an asynchronous socket, so execution of the client application is not suspended while the server returns a response. ...
...The server is built with an asynchronous socket, so execution of the server application is not suspended while it waits for a connection from a client. ...
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

oh yes, silly me :P
thanx a lot! :D
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Incidentally, I thought you were looking to raise your own events within a class before reading your post. For that, this walkthrough has been useful to me.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

wow that's great! I always wondered how to do that!
thanx again! :D
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

how do you find out the speed of the connection? if it is at all possible..
I had thought to send some test data and clock it, but it went all weird, so.. any tips?
Post Reply