none
Socket Connection RRS feed

  • Question

  • I have an application running where i receive events. I want to connect to the port 1666 and receive those event. Please guide me how i can accomplish that?

    regards,

    Monday, March 16, 2015 6:35 AM

Answers

  • As sockets are based on client/server architecture, this application is composed of a server and a client. The server will reserve a port number. Then it will listen to any upcoming client. The client then will attempt to connect to the server. When the connection succeeds, it will be possible to exchange text messages. When finished, the connection will be closed.

    This example shows how to send and receive data via TCP/IP using Socket in .NET Framework. There are methods Socket.Send and Socket.Receive.
    http://www.csharp-examples.net/socket-send-receive/ .

    http://www.codeproject.com/Articles/463947/Working-with-Sockets-in-Csharp .

    Wednesday, March 18, 2015 10:37 AM