LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-23-2005, 01:14 AM   #1
blackhole123
LQ Newbie
 
Registered: Nov 2005
Posts: 8

Rep: Reputation: 0
accept() not opening new ports.


Hello,

I have client server setup, S and C using TCp sockets.
linux1 as server and linux3 as
On server side i have an infinte loop, which accepts connections,

When i try to connect to a new to the listening port, it connects
but on server side no new port is openend, attaches itself to the Listening port,


# netstat -a | grep 59184
tcp 0 0 linux1.59184 *.* LISTEN

after connect,
# netstat -a | grep 59184
tcp 0 0 linux1.59184 *.* LISTEN
tcp 0 0 linux1.59184 linux3.32885 ESTABLISHED

so when i try to close the the new socket id , the listening socket is closed.

why is this happening, the server should have opened a new port to handle the new connection?
 
Old 11-23-2005, 05:48 PM   #2
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
The behavior you describe is pretty much how it's supposed to work as far as I know. Server listens on port x, client connects on server port x via client ephemeral port y, server accepts connection on port x. If you've programmed the server to fork, new client connections to the server will connect on server port x via client port z. From the server's viewpoint, all connections should occur on its listening port; it shouldn't open a new port for every connection. What am I missing?
 
Old 12-01-2005, 05:31 AM   #3
blackhole123
LQ Newbie
 
Registered: Nov 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the reply.
Sorry, i gooooofed up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why won't Apache accept and additional Listen ports? mikeghet Linux - Networking 22 11-08-2005 10:06 PM
opening ports I think jleipert Linux - Security 7 09-04-2005 09:14 AM
Opening ports lunke Linux - Security 10 06-07-2005 03:04 AM
Ports still not opening! Help? spam4scott Linux - Networking 1 05-28-2004 12:48 AM
rh9: configure ports to accept remote connection for azureus bleachie Linux - Software 0 02-16-2004 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration