LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-19-2008, 02:15 AM   #1
johnn
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
UDP server reply to client refused


Hi,

I'm working on a multiprocess udp server that replies to an initial client request from another port than the one it received the initial request. This scenario is described in the Stevens Unix Network Programming book.

However, the client responds with a "ICMP udp port unreachable" to the reply from another server port (other than the one on which server received the initial client request). recvfrom() just blocks in the client since there is no reply to read from the server.

netstat shows that the client is set to use the original server IP-port pair as the foreign address.

By default, the dgram socket should not be in a 'connected' state? I tried to set the client dgram socket to unconnected state with connect() (AF_UNSPEC), but that doesn't seem to work either. Actually, how can I verify that the socket is not in connected state? What could be the other causes which make the client refuse to receive replies from other server ports?

Ideas? Thanks!
 
Old 09-19-2008, 05:50 AM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
"What could be the other causes which make the client refuse to receive replies from other server ports?"
The first thing that springs to mind is NAT (network address translation) which would require a third entity to punch through a hole.
 
Old 09-19-2008, 05:58 AM   #3
johnn
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dmail View Post
"What could be the other causes which make the client refuse to receive replies from other server ports?"
The first thing that springs to mind is NAT (network address translation) which would require a third entity to punch through a hole.
The client host receives the UDP packets and there are no NATs in between the client and server. Anyway, thanks for your reply!
 
Old 09-19-2008, 06:04 AM   #4
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Well I would suggest that the client port is closed or you are not listening on that port in the client.

Last edited by dmail; 09-19-2008 at 06:13 AM.
 
  


Reply



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
UDP client / server program in c++ suddenly limited to 1468 bytes bricedebrignaisplage Linux - Networking 5 07-25-2008 12:13 AM
client/server echo program of UDP sockets memisbah Programming 2 04-08-2008 10:27 AM
simple udp server client programm in not working between two systems gssmsc Programming 4 02-26-2008 10:56 AM
how to get client ip address at udp server cranium2004 Programming 2 03-21-2005 11:35 PM
Server Client program using UDP frostmagic Programming 9 11-14-2003 11:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:25 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