What is the exception that you're getting?

-- 
Ian Griffiths - DevelopMentor
http://www.interact-sw.co.uk/iangblog/

> -----Original Message-----
> From: Peter Suter
> 
> Hi All,
> In a sub much like this one, from "Using an Asynchronous Client Socket
> [Visual Basic]", I keep getting an exception rather than a socket.
> Is there a problem getting the socket using this technique?
> (I'm trying to get the Client IP Address)
> 
> Private Shared Sub ConnectCallback(ar As IAsyncResult)
>     Try
>         ' Retrieve the socket from the state object.
>         Dim client As Socket = CType(ar.AsyncState, Socket)
> 
>         ' Complete the connection.
>         client.EndConnect(ar)
> 
>         Console.WriteLine("Socket connected to {0}", _
>             client.RemoteEndPoint.ToString())
> 
>         ' Signal that the connection has been made.
>         connectDone.Set()
>     Catch e As Exception
>         Console.WriteLine(e.ToString())
>     End Try
> End Sub 'ConnectCallback

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to