I have the following code to send a TCP/IP message to a specific IP Address and Port:
public bool sendTCPMessage(string ip_address, string port, string trans
You'd need a TcpListener object to act as the server. The TcpListener
object would listen for incoming connections on the specified port. You can use the .AcceptTcpClient method to establish a new connection. (If you wanted multiple clients you'd have to look into multithreading)
Also as a side note using Port 1 would be bad practice, low port numbers are usually reserved for system stuff or standard protocols such as telnet
, ftp
, http
etc.