Article View: borland.public.cppbuilder.nativeapi
Article #17631binded address
From: Boguslaw Fries
Date: Fri, 07 Mar 2003 12:54
Date: Fri, 07 Mar 2003 12:54
22 lines
1343 bytes
1343 bytes
Hello,
If I have a pointer to a opened Socket, could I find the information
about Remote address and Remote Port?
Local Address and Local Port is simple:
SOCKET s;
SOCKADDR_IN name;
szLocalAddress char[ 256 ];
int sockType = 0;
int optlen = 4;
if( (getsockopt( s, SOL_SOCKET, SO_TYPE, ( char * ) &sockType, &optlen ) !=
SOCKET_ERROR )
{
sprintf( szLocalAddress, "%s:%d", inet_ntoa( name.sin_addr ), ntohs(
name.sin_port );
}
Best Regards
Boguslaw Fries
Technical Details
Message-ID:
<3e68956a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,522e24851519f924,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-07 04:54:05 PST From: "Boguslaw Fries" <B.Fries@luca-online.de> Newsgroups: borland.public.cppbuilder.nativeapi Subject: binded address Date: Fri, 7 Mar 2003 13:54:43 +0100 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 217.82.86.208 Message-ID: <3e68956a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1047041386 217.82.86.208 (7 Mar 2003 04:49:46 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail