Specifying send port for client
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Specifying send port for client




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Specifying send port for client  
Madhur


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-15-07 06:25 AM

Hi All,

I am writing a small client/server program. I have a peculiar
requirement that the client program while sending the data to the
server has to send the data from the user defined port. But the thing
what i have observed is that the client binds to some random ephemeral
port before sending the data. I could not find any option that i can
set for the client program to bind to port to some predefined value.
The kernel always picks from the set of random ports.

I would like to know, if there is any option, so that i can mandate
the client program to send the data through a predefined port. As
there is a option in listen() for server, to listen on a particular
predefined port.

Thanks,

Regards,
Madhur






[ Post a follow-up to this message ]



    Re: Specifying send port for client  
Bin Chen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-15-07 06:25 AM

On Mar 15, 12:24 pm, "Madhur" <madhurr...@gmail.com> wrote:
> Hi All,
>
>        I am writing a small client/server program. I have a peculiar
> requirement that the client program while sending the data to the
> server has to send the data from the user defined port. But the thing
> what i have observed is that the client binds to some random ephemeral
> port before sending the data. I could not find any option that i can
> set for the client program to bind to port to some predefined value.
> The kernel always picks from the set of random ports.
>
What is your 'bind' mean, it means the system do the binding for you
or you explicitly call bind() before you send the data?

If you do not call bind(), do it.
> I would like to know, if there is any option, so that i can mandate
> the client program to send the data through a predefined port. As
> there is a option in listen() for server, to listen on a particular
> predefined port.
>
> Thanks,
>
> Regards,
> Madhur







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:37 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register