-
April 27th, 2010, 07:07 AM
#1
Regarding Socket
Hi all,
Here are some questions, plz kindly share your ideas on that
1) Where should the socket be closed ideally? is it while closing the application or after receiving the response from the device.
2) How to know if any data has arrived on the socket? is there any in-built function triggered on receiving some data on the socket?
3) How do v know if the socket is already created?
Thanks & Regards
daffodils180
-
April 27th, 2010, 07:15 AM
#2
Re: Regarding Socket
1) Where should the socket be closed ideally? is it while closing the application or after receiving the response from the device.
Neither. Close it when you're finished with it.
2) How to know if any data has arrived on the socket? is there any in-built function triggered on receiving some data on the socket?
Use the asynchronous socket methods. When your callback is invoked, data is available on the socket or the socket has been closed.
3) How do v know if the socket is already created?
Sockets can only be created once so if you get an exception creating the socket, it's already created.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
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
|