G
Guest
Greetings,
Hope I'm posting in the right group.
I set up a Socket with my local IP and a port on which nothing is listening.
When I use .Connect, I get the expected SocketException 10061 No connection
could be made because the target machine actively refused it.
Now, when I use .BeginConnect / .EndConnect no exception is thrown on
..EndConnect and the code continues. I get an error on .BeginReceive telling
me the Socket is not connected. If I try the .BeginConnect / .EndConnect a
second time, I do get the expected 10061 ErrorCode.
This behaves the same in .NET 1.1 and 2.0. Am I missing something or is
there a reason why the first .EndConnect does not throw an exception like I
expect it to?
Thanks,
Mike
Hope I'm posting in the right group.
I set up a Socket with my local IP and a port on which nothing is listening.
When I use .Connect, I get the expected SocketException 10061 No connection
could be made because the target machine actively refused it.
Now, when I use .BeginConnect / .EndConnect no exception is thrown on
..EndConnect and the code continues. I get an error on .BeginReceive telling
me the Socket is not connected. If I try the .BeginConnect / .EndConnect a
second time, I do get the expected 10061 ErrorCode.
This behaves the same in .NET 1.1 and 2.0. Am I missing something or is
there a reason why the first .EndConnect does not throw an exception like I
expect it to?
Thanks,
Mike