Re: Widnows sending RST in tpc/ip connection




"Dave Lowther" <davel@xxxxxxxxx> wrote in message
news:OiWa$GD8FHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
> "Niklas Olsson" wrote in message
>>
>> Thank you for the suggestions,
>> however I can't get it to work, but maybe I'm doing it wrong.
>> I used
>> Socket = socket (AF_INET, SOCK_STREAM, 0):
>> and then
>> local_sin.sin_family = AF_INET;
>> local_sin.sin_port = htons (nPort);
>> local_sin.sin_addr.s_addr = htonl (INADDR_ANY);
>> bind (Socket, (struct sockaddr *) &local_sin,
>> sizeof (local_sin)
>>
>> I thought that this might be enough, but is it?
>> I tried also to call listen() after bind but I always end up with windows
>> (or some program other than mine) sending the reset message.
>> Since everything works find if I let winsock connect, there must be
>> something I don't do correctly.
>> (my SYN message seem to be working fine (I get back the SYN,ACK) and in
>> comparassion to the SYN winsock send I can't find any differencies except
>> checksum)
>> I don't have any firewall running that would block.
>
> Is your code a TCP/IP client, or server ?
>
> Probably not necessary but I usually memset() the struct sockaddr with all
> 0's before filling out the required fields.
>
> If it's a client:
> o You shouldn't be setting the port number for bind, in fact why call bind
> at all.
> o You should be calling connect()
>
> If it's a server:
> o You should call socket(), bind(), listen(), accept()
> o You should be setting the port number with bind
> o You should use the socket returned by accept() to talk to the client.
>
> HTH
>
> Dave.
>

Thanks for the suggestions Dave,
The thing is, I can't use Connect() (it's just to slow (if there is no peer
in the other end))
So I communicate directly with the adapter and send my message.
(and my program is a client)
I got fooled earlier that it worked because the windows firewall was on,
which makes the ports stealth if I'm not mistaken but now that I turned it
off, windows will answer with a reset message that the port I send on is not
in use.
But perhaps it's not winsock I should look at, I just want to tell windows
that the port 9704 (or any other I specify) is un use and that it should not
send any reset message.

thanks
/Niklas


.



Relevant Pages

  • Re: Widnows sending RST in tpc/ip connection
    ... >>> windows sending the reset message. ... >> Is your code a TCP/IP client, ... >> o You shouldn't be setting the port number for bind, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Serial port redirection
    ... Does anyone know if you have to use windows 2003 in order ... If you use Windows 2003 and the latest rdp client, ... >COM port, and expects an acknowledgement. ... >MCSE, CCEA, Microsoft MVP - Terminal Server ...
    (microsoft.public.windows.terminal_services)
  • Listening application on as400 via VPN
    ... I have an RPG application listening on port 31001. ... There is a client application (WINDOWS) that talks with the as400 ... Everything works fine when the client application ...
    (comp.sys.ibm.as400.misc)
  • Re: Zugriff RealVNC auf XP Home Rechner =?ISO-8859-15?Q?=28=FCbe?= =?ISO-8859-15?Q?r
    ... Habe den Port ... noch direkt über die IP komme ich aber auf den VNC. ... nutze aber jetzt nur noch den eingebauten Remotedesktop bzw. die Remoteunterstützung von Windows XP. ... Bei VNC benütze ich nur noch UltraVNC SC, da dies auf der Seite des ferngesteuerten Systems keinerlei Änderungen an der Routerkonfiguration benötigt und der Client nur ein paar kB groß ist. ...
    (microsoft.public.de.german.windowsxp.networking)
  • Re: Remote Desktop Client for Pocket PC.
    ... The PocketPC Terminal Services Client is built-in to the Windows Mobile 2003 OS and the factory ... your running a PPC 2002 Upgraded device, ie. like an iPAQ 3835, you can download a client from... ... The PocketPC TSC does *NOT* allow you to address a different port than the default ... TCP Port 3389. ...
    (microsoft.public.windowsxp.work_remotely)