disconnect

MORPG Server not catching disconnection.

Ok, simple problem hopefully. I have started to make a simple server for a simple MORPG game im making, the client connected, and then disconnects, simple, the server catches the new client, but doesn't catch when it disconnects, whats wrong? Im hoping its something stupidly obvious. Here's my server code: using System; using System.C...

How can I detect a USB disconnect event? (Windows, .NET C# application)

Hi, Currently how I do this is I poll for a masked list of USB devices (masked specifically for the device I'm working with) and if it's there, I continue, if not then I notify the user that the device is not connected. The method for getting a list of USB devices is provided for me through a USB peripheral controller chip manufacturer...

Android InputStream Internet Disconnect

Hello, In my Android program, I have some code that downloads a file. This works fine, but since on a cell phone, you can be disconnected at any time, I need to change it do it reconnects and resumes the download when you are halfway through and somebody calls/you lose cell reception/etc. I cannot figure out how to detect the InputStream...

Server disconnects in Java

Related posts didn't answer my question. I have a server which does something like: EVERY TWO SECONDS DO: if the inputstream is not null { if inputStream.available() is 0 { return } print "handling input stream" handleTheInputStream(); } Even after my client disconnects, the server doesn't recog...

Why can't I disconnect my database handles with DBD::DB2?

My perl script is slow but works. I am considering throwing it out and building a true DB2 application with proper binds and such; however, in the meantime I want this to work as a place holder. I looked at this documentation and it mentions: $dbh->disconnect(); However I cannot use it because it throws this error. Can't locate...

How to detect USB device disconnect under Linux/Qt/C++

I'm writing a system (X-Platform Windows/Linux) that talks to a custom device using an FTDI USB chip. I use their D2XX driver for device open/close/read/write. So far, so good. I need to know when the device is disconnected so the program can respond gracefully. At present, under Windows the application receives a sudden unexpected...

When restoring a backup, how to disconnect all active connections?

My SQL Server 2005 doesn't restore a backup because of active connections. How to force it? ...

dojo.disconnect question

How do you remove a dojo connected event if you do not have the "handle" that was returned during the dojo.connect? My example involves dynamically assigning a set of events to a set of objects. (for simplicity, the events are onclick and ondblclick, and the objects are rows within a table) So, during page setup events are connected ...

WCF - have client check for service availability.

Hi, I have a client-server system, both sides written by me, and I would like to put the clients in an 'offline' state when the server disconnects/dies, and then automatically bring them back 'online' when the server is available again. For the first part, I listen for channel faulted events and handle that by setting the client to off...

Best practice to detect a client disconnection in .NET ?

I'm developing a server in C# which can accept only one client and I need to know when this client is disconnected to be able to accept another connection requests. I'm using a first Socket which continuously listen to connection request with Socket.BeginAccept and accept or reject clients. When a client is accepted, the new Socket whic...

Unable to detect client disconnect on SendAsync

Hi, I have Server that needs to echo back data from client continously with a delay of 1 second. Following is the code. private void ProcessSend(SocketAsyncEventArgs e){ if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success) { System.Threading.Thread.Sleep(1000); // Done echoing data back to the client....

Detecting client TCP disconnection while using NetworkStream class

A friend of mine came to me with a problem: when using the NetworkStream class on the server end of the connection, if the client disconnects, NetworkStream fails to detect it. Stripped down, his C# code looked like this: List<TcpClient> connections = new List<TcpClient>(); TcpListener listener = new TcpListener(7777); listener.Start()...

TCP disconnection if no data

Hi! I've checked out TCP protocol Wiki, but haven't found, if socket connection will time out if no data is transferred during the long period. I mean.. there will be no physical problems, but two computers will just have no data to send each other for some time. How connection will still exist? Will there be some low-level data transfer...

Android HttpURLConnection disconnect doesn't work

The method disconnect from HttpURLConnection seems not to work properly. If I execute the following code: url = new URL ("http:// ..."); connection = (HttpURLConnection) url.openConnection (); connection.setRequestMethod ("POST"); connection.setRequestProperty ("Content-Type", "application/x-www-form-urlencoded"); connection.setUseCache...

Detect client has disconnected from jetty server (using continuations)

Hi all, I am using jetty continuations and I was wondering if I can detect that the client has disconnected(closed connection to jetty server) from the server. Thanks, Alfred ...

How to detect a client disconnect using a named pipe client/server?

I'm learning about named pipes and was playing with the named pipe client and server examples from the MSDN doc: Named Pipe Server Named Pipe Client I modified the client so I can type in messages to the console and have them sent to the server where it displays the message and sends back a reply. Essentially I added a loop which star...

php - disconnecting and connecting to multiple databases

Hi, I want to be able to switch from the current db to multiple dbs though a loop: $query = mysql_query("SELECT * FROM `linkedin` ORDER BY id", $CON ) or die( mysql_error() ); if( mysql_num_rows( $query ) != 0 ) { $last_update = time() / 60; while( $rows = mysql_fetch_array( $query ) ) { $contacts_db = "NNJN_" . $rows['e...

Java Socket Disconnect Reporting vs. C# Disconnection

in C# when a sockets connection is terminated the other node is informed of this before terminating the link thus the remaning node can update the connection status. in Java when i terminate a communication link the other node keeps reporting the connection as valid. do i need to implement a read cycle (makes sense) that reports the co...

Connection reset when calling disconnect() using enterprisedt's ftp java framework

I'm having trouble disconnecting from a ftp-server, using the enterprisedt java ftp framework. I can simply not call disconnect() on a FileTransferClient object without getting an error. I do not do anything, besides connecting to the server, and then disconnecting: // create client log.info("Creating FTP client"); ...

WCF net.tcp server disconnects - how to handle properly on client side?

I'm stuck with a bit of an annoying problem right now. I've got a Silverlight 4 application (which runs OOB by default). It uses WCF with net.tcp as means of communicating with the server. The client uses a central instance of the wcf client proxy. As long as everything keeps running on the server side, everything's fine. If i kill the...