🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17649

Re: binded address

#17649
From: Michel Leunen
Date: Sat, 08 Mar 2003 11:41
20 lines
1704 bytes
Boguslaw Fries wrote:

> getpeername( s ( SOCKADDR * ) & speer, &namelen ) gives SOCKET_ERROR
> and WSAGetLastError  gives 10057

Error 10057 means socket not connected. Are you properly connected to 
your peer address? Do you use connect() before using getpeername():

SOCKET s=socket(AF_INET,SOCK_STREAM,0);
...
connect(s,(sockaddr*)&speer,sizeof(SOCKADDR_IN));
getpeername(s,(sockaddr*)&speer,&namelen);

Michel
-- 
----------------------------------------
Michel Leunen
mailto:michel@leunen.com
http://www.leunen.com/cbuilder/
----------------------------------------
Technical Details
Message-ID: <3e69d6ef$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e68956a@newsgroups.borland.com> <3e68e277$1@newsgroups.borland.com> <3e69d1eb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,522e24851519f924
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-03-08 06:42:44 PST
Date: Sat, 08 Mar 2003 12:41:31 +0100
From: Michel Leunen <mleu@skynet.be>
Organization: http://www.leunen.com/cbuilder/
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: binded address
References: <3e68956a@newsgroups.borland.com> <3e68e277$1@newsgroups.borland.com> <3e69d1eb$1@newsgroups.borland.com>
In-Reply-To: <3e69d1eb$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 80.200.25.27
Message-ID: <3e69d6ef$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1047123695 80.200.25.27 (8 Mar 2003 03:41:35 -0800)
Lines: 21
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail