This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/345] getsockname returns a value different of zero when successful
- From: "deathwing00 at forums dot gentoo dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 21 Sep 2004 14:10:11 -0000
- Subject: [Bug libc/345] getsockname returns a value different of zero when successful
- References: <20040825161035.345.deathwing00@forums.gentoo.org>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From deathwing00 at forums dot gentoo dot org 2004-09-21 14:10 -------
Oops. I saw your comment.
After modifying my code a bit more (with the source I provided you) I got this:
ioannis@petekan gso $ ./gso www.google.com 80
gethostname OK
socket OK
connect OK
getsockname Success
getsockname: 10.30.102.123:56575
getpeername Success
getpeername: 66.102.9.104:80
EXITING
Should have done that from the begining.
In the code:
if(getpeername(SocketDesc,(sockaddr *)&gsoSA,&gsoSL))
{
cout << strerror(errno) << endl;
return -4;
}
If the returned value is zero, the statement is false, so it won't exit. I
still don't understand why it failed in the previous code. Anyway. Now I have
my app up and running.
Thanks for the time.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |WORKSFORME
http://sources.redhat.com/bugzilla/show_bug.cgi?id=345
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.