Re: [ADVANCED-DOTNET] Client IP Address

2004-07-22 Thread Peter Suter
I was getting the impression it was time I built this myself rather than retrofitting an example. Which leads on to my next question. I'm also getting a very strong impression that multithreaded listeners are best implemented in C#. I'm particularly focused on stability, scalability and performance

Re: [ADVANCED-DOTNET] Missing callbacks from asynchronous sockets?

2004-07-22 Thread Manuel Costa
lock... i remember that i had a horrible problem with deadlocks and asynchronous sockets. It was a nightmare to find out what was happening! I don't remember the behavior, though. Are you doing synchronization? - Original Message - From: "Garry Barclay" <[EMAIL PROTECTED]> To: <[EMAIL PRO

Re: [ADVANCED-DOTNET] Missing callbacks from asynchronous sockets?

2004-07-22 Thread John Davis
Our server only has one appdomain, and it works great. Another thing you really need to be careful about is the whole callback thing. Assume that your callbacks will be coming back on multiple IO threads. This will definitely be the case when running on a multi-processor box (or hyperthreaded

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
Thanks, 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? - Original Message - From: "Jeff Paulsen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 23, 2004 4:42 AM Subject: Re: [ADVANCED-DO

Re: [ADVANCED-DOTNET] Missing callbacks from asynchronous sockets?

2004-07-22 Thread Manuel Costa
Are you using application domains != from main application domain to host and execute System.Net.Sockets? If so, did you try to do the same in the main application domain? Manuel P.S.: good luck! - Original Message - From: "Garry Barclay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent

Re: [ADVANCED-DOTNET] Missing callbacks from asynchronous sockets?

2004-07-22 Thread Garry Barclay
This problem is happening on a fresh installation of .Net Server 2003. There's no virus checker running. There's no explicit pinning in our code - the framework Socket implementation pins the buffers before issuing the IOs to winsock. Our application is a fairly big one, with multiple appdomains

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] Multithreaded hash table access

2004-07-22 Thread Heath Ryan
Hmm, If you never remove the entries in the hashtable (what you seem to do with the dataTables) you can simplify it like... Hashtable ht = new Hashtable(); Hashtable locks = new Hashtable(); private object GetLockObject( HashKey key) { object singleLock = locks[key]; if ( singleLock == null

Re: [ADVANCED-DOTNET] Multithreaded hash table access

2004-07-22 Thread Heath Ryan
Hi James, I thought about that, but wanted to keep things simple ;) Lets try this one, (very experimental)... Hashtable ht = new Hashtable(); Hashtable locks = Hashtable.Synchronized( new Hashtable()); private object GetLockObject( HashKey key) { Object object = locks[key]; if ( object == n

Re: [ADVANCED-DOTNET] Multithreaded hash table access

2004-07-22 Thread James Berry
Hi Ryan, This looks better than my original suggestion - however, this doesn't allow for different combinations of parameters to be called in parallel: this database call could take a few seconds, and the results depending on the parameters will be different. Perhaps I need a hashtable of lock ob

Re: [ADVANCED-DOTNET] Multithreaded hash table access

2004-07-22 Thread Heath Ryan
Hi James, the synchronized Hashtable only syncs the hashTable to sync also the db access, try this one... Hashtable ht = new Hashtable(); public DataTable GetList( int a, int b, int c) { // lookup the dataTable DataTable dt = (DataTable)ht[key]; if ( dt == null) { // since our last