Re: Socket Error?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




<Buc> wrote in message news:%23wOmTO1%23FHA.2588@xxxxxxxxxxxxxxxxxxxxxxx
> I wrote a few lines of code to send a UDP packet to a remote machine. What
> worries me is the program code says it sends the data regardless of the
> remote IP or port. If the IP is ok , a sniffer verifies the packet was
sent.
> However, if I give the sendto statement a bogus IP or port (that is not
open
> on the remote machine), the code executes with no errors. I know UDP is
> connection-less, but the framework should balk at the bad or port (or at
> least it does in C or VB6). Any ideas how to get an error return? I used
to
> get a destination or port unreachable error in VB6, when I did a sendto
with
> a bogus IP or closed port. Heres the code:
> Lets say my network is 192.168.0.0..
....

Hi,
You should not count on sendto returning destination unreachable error when
host is unreachable. Only one special case exists when system can know that
host is unreachable and that is when local computer has no route to that
host. If you have default gataway or route to destination, you will never
get destination unreachable (sendto will return immediatly, buffering the
request to the OS). "Port unreachable" is not listed in error codes of
windows socket API. The only way you can tell that host is unreachable is by
time-out on host reply.

When using UDP, you must provide your own flow controll, error
detection/correction and retransmition. Plus be aware that UDP lacks
congestion controll, witch can have very unpleasant consequences on your
whole network if you are not aware of that.

Regards,
Goran


.



Relevant Pages

  • Re: Port 138
    ... > It is quite clear from the log file that the host pc's UDP 138 port is ... trying to connect to a non-existant IP address on the same UDP 138 port. ... > Do you have any idea as to why is it trying to connect the non-existant IP ...
    (microsoft.public.win2000.security)
  • Re: Remote debugging
    ... DCOM RPC is sitting on port 135. ... I can ping the system and telnet can open port 135 on the remote machine from the host machine. ... 'password' to fill-in although I don't have any password login in the target. ...
    (microsoft.public.windowsxp.embedded)
  • UDP port 19690
    ... Can anybody point me out what is the possible application listening on UDP ... I noticed one of my host is blasting off a huge load of fragmented UDP ... packets to an internet accessible host at UDP port ... All of our class sizes are guaranteed to be 10 students or less to facilitate one-on-one interaction with one of our expert instructors. ...
    (Security-Basics)
  • How to use "telnet" to launch another program on a remote machine from c++ code?
    ... The program will use telnet ... It will connect to a host that the user will input to a ... How to set a timeout if there is no response from remote machine? ...
    (comp.unix.solaris)
  • Monitoring Tools
    ... server, from a remote machine. ... they all ask for a listening port, host, and port. ... any of the calls I'm making to the server. ...
    (comp.software.testing)