Re: Simple email pop3/smtp source - I get a bind error



"Test" <test@.nil.invalid.com> wrote in message
news:vq4e24hfbn35ovkqkt0bvu955dm5gobbs1@xxxxxxxxxx
I need to check the headers fo my email using smtp/pop3

When bind'ing to a mail server I get bind error:

...
h=gethostbyname("mail.whatever.fi");
service.sin_addr.s_addr=inet_addr(inet_ntoa(*((struct in_addr
*)h->h_addr)));
service.sin_port=htons(110);
if (bind(mylistens, (SOCKADDR*)&service, sizeof(service)) == SOCKET_ERROR)
{
blah blah error here

If you are writing a client, you should not be binding to the server port
number.

You only need to use the server port number when your client calls connect.

HTH

Dave.


.



Relevant Pages

  • Re: Multiple connections, same port
    ... (server addr,server port,client addr,client port) ... same server port. ... This is effectively enforced at the client end where you will not be able to ... I assumed that a new connection will receive a unique port. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: remoting over router/NAT
    ... just the server is behind a NAT. ... remoting is running one-way (client to server) so you should ... You only need to specify the server port - there is no need to specify any ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: [opensuse] 2GB File size limit exceeded over NFS on 10.3
    ... rpcinfo and nfsstat shows that server and ... client are both running both v2 and v3. ... NV SERVER PORT USE HOSTNAME ...
    (SuSE)
  • Re: How to Upgrade OpenLDAP
    ... Do I just install the server? ... That Makefile references the server port, ... Building the client will run the Makefile in server, the overall port, ...
    (freebsd-questions)
  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)

Loading