I am new to C# and I need to build a few different apps of the next few months that communicate via socket communication. I have done this with VB in the past and I need to do something similar with C#. I have taken a stab at this myself and I can't seem to get it working. Working with the UI thread and a worker thread and passing data from one to the other has got me frustrated. I wonder if someone has built a class that has the events that I can use to grab the data on the UI thread and display it etc that they are willing to share. I have looked at a lot of examples and tried lots of things but I can't seem to get it working.
Any suggestions or help would be great.
Darby
Loading
Sam HobbsPosted Feb 21, 2012, 3:03 PM
Note that the subject of a thread can be critical. The subject here is "Asynchronous Sockets Class with events" so it is less likely that members will look at it.
You said "use the socket.beginConnect method and then update the UI". That is a UI question. To the extent that it is not a UI question you are asking very much in this one thread.
Try asking more specific questions in each thread.
You are welcome to try other forums, but you will get better help anywhere you go if you are more specific.
Darby NelsonPosted Feb 21, 2012, 10:52 AM
Darby NelsonPosted Feb 15, 2012, 11:51 AM
I am very green and would love to see an example of this implemented. I have read many articles and tried many approaches and so far I have been unsuccessful.
There is an example that is doing basically just what I want that I downloaded ( http://www.c-sharpcorner.com/UploadFile/thmok/Peer2PeerChatAsynchSocket11222005235425PM/Peer2PeerChatAsynchSocket.aspx) that does essentially what I am looking for but just like my attempts it doesn't work.
Sam HobbsPosted Feb 15, 2012, 10:49 AM
The BackgroundWorker class is designed to do what you are asking about. Have you tried it?