Re: [ADVANCED-DOTNET] Client IP Address

2004-07-25 Thread Andrew Gayter
cleanup correctly - remember sockets are unmanaged resources! Hope this helps A -Original Message- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Ian Griffiths Sent: 24 July 2004 14:57 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] C

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-24 Thread Ian Griffiths
> I'm also getting a very strong impression that multithreaded > listeners are best implemented in C#. Speaking as someone who much prefers C# to VB.NET, I don't actually agree. I'm not aware of anything C# can do that makes it more able to implement a multithreaded listener than VB.NET - the sam

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-22 Thread Peter Suter
king fine but I need to add in some client address validation so the clients can't populate each others data. Thanks - Original Message - From: "Ian Griffiths" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 22, 2004 9:17 PM Subject: Re: [ADV

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-22 Thread Jeff Paulsen
> I saw one of these in the help, but I couldn't figure out how and where to > plug it in. > Can you explain how your would implement this? This is one way of doing it - change it as needed for your situation. You'll want to break this up into separate functions, threads, etc. Dim tcpListener As

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-22 Thread Peter Suter
2 AM Subject: Re: [ADVANCED-DOTNET] Client IP Address > > but then I get property client() is not accessible in this context because > > it's protected > > The quick and dirty solution to this might be to make a subclass of > tcpclient that doesn't have

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-22 Thread Jeff Paulsen
> but then I get property client() is not accessible in this context because > it's protected The quick and dirty solution to this might be to make a subclass of tcpclient that doesn't have its socket property marked Protected, thus: Class ExposedSocketTcpClient Inherits TcpClient

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-22 Thread Ian Griffiths
> Dim ClientSocket As Socket = Me.Client > which should(?) be > Dim ClientSocket As Socket = Myclient.Client > but then I get property client() is not accessible in this > context because it's protected > > Can you tell me how to get the socket in this context, or do > I need to pick it up from t

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-20 Thread Peter Suter
Thanks, that helps a lot. My biggest problem is probably the MS example I chose to build from. - passing nothing in the state parameter - I was inside a class called 'client', making it a bit tough to get the TCPClient.client (socket) So, I think I've sorted that out with 'class UserConnection, th

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-20 Thread Ian Griffiths
OK, you're now showing us a different bit of code from before. The first snippet was calling EndConnect, so you want to find the corresponding call to BeginConnect. (That's why I asked what you were passing to BeginConnect in my previous post.) However, you've got the same problem in the code exam

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-19 Thread Peter Suter
Socket = CType(ar.AsyncState, Socket) Dim ClientSocket As Socket = client.??? Dim ClientIPAddress as string =ClientSocket .RemoteEndPoint.ToString()) - Original Message - From: "Ian Griffiths" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 20, 2004 9:49 AM

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-19 Thread Ian Griffiths
At the risk of going for the obvious question, are you actually passing in the socket as the 'state' parameter when you call BeginConnect? If 'client' is null in this situation, that implies that ar.AsyncState was also null, which implies that you passed in null as the 'state' parameter when you c

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-19 Thread Peter Suter
be not that I get an exception, but that client=Nothing in the first place. Thanks for any suggestions - Original Message - From: "Ian Griffiths" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 19, 2004 7:44 PM Subject: Re: [ADVANCED-DOTNET] Client IP A

Re: [ADVANCED-DOTNET] Client IP Address

2004-07-19 Thread Ian Griffiths
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 exceptio

[ADVANCED-DOTNET] Client IP Address

2004-07-18 Thread 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 IAsyncRes