Socket Connection, help me please!!!!
-
I've a project about socket and have some trouble.... I've create a serverSocket on port 80 of a server : (IPserver,80) And then create a clientSocket on port 80 of some clients: (IPclients,80) So i need a code to do First I've created a serverSocket and listening communicate from clientSocket (done) Second I need a code on clientSocket to do 0. Create clientSocket 1. Connect to serverSocket 2. To do something.. 3. Disconnect 4. Sleep and wait 5. Connect to serverSocket 6. To do something.. 7. Disconnect 8. Destroy clientSocket I don't know how to code method Create clientSocket, method Connect to serverSocket, method Disconnect. Anyway thanks for your reply
Le Trung Hieu
-
I've a project about socket and have some trouble.... I've create a serverSocket on port 80 of a server : (IPserver,80) And then create a clientSocket on port 80 of some clients: (IPclients,80) So i need a code to do First I've created a serverSocket and listening communicate from clientSocket (done) Second I need a code on clientSocket to do 0. Create clientSocket 1. Connect to serverSocket 2. To do something.. 3. Disconnect 4. Sleep and wait 5. Connect to serverSocket 6. To do something.. 7. Disconnect 8. Destroy clientSocket I don't know how to code method Create clientSocket, method Connect to serverSocket, method Disconnect. Anyway thanks for your reply
Le Trung Hieu
You should start off by examining the System.Net namespace in the .Net framework. Then if you have a specific question post it here.
-- Cheers, Gary http://www.garyshort.org
-
I've a project about socket and have some trouble.... I've create a serverSocket on port 80 of a server : (IPserver,80) And then create a clientSocket on port 80 of some clients: (IPclients,80) So i need a code to do First I've created a serverSocket and listening communicate from clientSocket (done) Second I need a code on clientSocket to do 0. Create clientSocket 1. Connect to serverSocket 2. To do something.. 3. Disconnect 4. Sleep and wait 5. Connect to serverSocket 6. To do something.. 7. Disconnect 8. Destroy clientSocket I don't know how to code method Create clientSocket, method Connect to serverSocket, method Disconnect. Anyway thanks for your reply
Le Trung Hieu
Hi create two ports which should be available in network one is for listening and one is for recieving that means listner port will be the receiver port in another side and vice versa then inside the listen method use the start method and send method inside the reciever method use the start method and recieve method of socket ..after that use stop method or close method in connectin close Hope u have got some fair idea from this.Lots of examples are their in code project...
Regards DilipRam
-
Hi create two ports which should be available in network one is for listening and one is for recieving that means listner port will be the receiver port in another side and vice versa then inside the listen method use the start method and send method inside the reciever method use the start method and recieve method of socket ..after that use stop method or close method in connectin close Hope u have got some fair idea from this.Lots of examples are their in code project...
Regards DilipRam
Thanks for your help. But I only use one port(80).
Le Trung Hieu