TcpClient / Socket Exception

csharp Sweden
  • 14 years ago

    I have a simple application with a network stream using the TcpClient class. My operations are setup and run using the Async methods (Being... / End...)

    Everything works fine until I want to close the connection, or re-connect.

    When I try to call the BeginConnect the second time (after closing the existing stream) I get a SocketException. Its driving me crazy!!! I dont know why it is thrown

    Here is the exact error:

    SocketException was unhandled
    -------------------------------
    The attempted operation is not supported for the type of object referenced.
    ErrorCode: 10045


    Please help me with this! :)













Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”