473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to get foreign ip address through port

what do i have to do to get the IP address connected to my computer on a certain port, after i provide the port number.

remote computer is already connected to a certain port and i know that port number
now i want to find out whats the IP address of that remoate computer

like netstat command in windows
where a list of IP addresses and ports is shown

Proto Local Address Foreign Address State
TCP pcname:1027 FLH1Adu111.tky.mesh.ad.jp:58597 ESTABLISHED

by giving 1027 as port number i want to be able to get FLH1Adu111.tky.mesh.ad.jp

i hope i have made my question clear
thanks
Jan 24 '09 #1
1 4092
JosAH
11,448 Expert 8TB
Have a look at the getpeername() function.

kind regards,

Jos
Jan 25 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
2
by: geoff | last post by:
The table creation script(at the end of this post) works fine on 4.0.1-alpha-win, but the foreign key constraints fail on 4.0.15-win. I am starting the server with the same command for both...
0
by: Rainer Collet | last post by:
Hi! I have a question how to solve the folloing task: I have 2 tables referencing each over: An user table and an address table. Each user has one or no address. If an user is dropped the...
0
by: Phil | last post by:
I am using MySQL 4.1.1-1. When I add a "named" foreign key constraint alter table sb_query_nm_sub_tp add constraint f1sbquerynmsubtp foreign key (query_nm) references sb_query_class...
10
by: D. Dante Lorenso | last post by:
I'd like to run a clean up command on my tables to eliminate rows that I'm no longer using in the database. I want to do something like this: DELETE FROM tablename WHERE...
8
by: wespvp | last post by:
I am using PostgreSQL 7.4.1 on RedHat 7.2. The query I am executing is something like (I replaced all the return values with 'count'): db=> explain select count(*) from messages m join (select...
4
by: andreas.w.h.k. :-\) | last post by:
How do I change the address location in the wsdl <wsdl:port name="SearchSoap12" binding="tns:SearchSoap12"> <soap12:address location="http://searchservices/engine/search.asmx" /> </wsdl:port> ...
3
by: GavinM | last post by:
I have the same question as andreas.w.h.k asked on 1/5. Our configuration is as follows: The client must use the URL https://clustername.xyz.com/webservice.asmx to access this web service. ...
6
by: Nicolas Noakes | last post by:
Hello, I would like to convert to following process to code. Any advice is welcome. I have a hardware device which requires the this procedure to set it's IP address. First create an static...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.