pensono
pensono

Reputation: 326

How to accept on a certain port with linux network code

I am in a situation where I must use a particular port for firewall reasons on one side to make a peer to peer connection. I was wondering if it's possible to open a connection with a client on a particular port. I know about the listen() and accept() functions.

Thanks

Upvotes: 0

Views: 86

Answers (1)

Ed Heal
Ed Heal

Reputation: 59987

You need to use bind (http://linux.die.net/man/2/bind).

There are many examples of servers on the web.

Upvotes: 1

Related Questions