LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-26-2004, 07:10 AM   #1
rasanth
LQ Newbie
 
Registered: Sep 2004
Location: Bangalore
Posts: 7

Rep: Reputation: 0
Getting Port on which client is listning from the client program.


All,
After the client connects to the server, is there any way by which I can know , on which port the client is recieving(on the client side) data from the server?
Thanks in Advance,
Rasanth
 
Old 10-26-2004, 08:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
use a tool like ntop or ethereal to listen to the traffic
 
Old 10-26-2004, 12:23 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Code:
netstat -plant | sed -n 's/[^:]*:\([0-9]*\) .*firefox.*/\1/p'
I used "firefox" here to test. Replace "firefox" in the above example with the program name on the client you want the port number of.

I find "netstat -plant" an useful command for finding info on TCP connections (and easy to remember).
 
  


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
Bonding:Error:Found a client with no channel in the client hash table niravdani Linux - Networking 2 08-19-2013 08:31 AM
can not connect to my pureftp server from Linux client, but i can from windows client bonito Suse/Novell 5 03-16-2005 10:45 PM
Bonding:Error:Found a client with no channel in the client hash table niravdani Red Hat 1 03-10-2005 08:13 AM
Apache/SSL - works with Windows client but not Linux client RickHDYoung Linux - Security 1 07-01-2004 05:02 PM
Refresh client user list at autentication client/server network. robertoneto123 Linux - Networking 0 11-11-2003 11:38 AM


All times are GMT -5. The time now is 02:37 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration