This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/345] getsockname returns a value different of zero when successful


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]