I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for ... |
I have an application that uses simple sockets to pass some characters between two systems. I have my java application running as a server. I establish a connection fine, ... |
I am writing a quick server to test an application. If I close the socket on the client end it does not throw an exception that the socket is closed. I ... |
I have a problem with Socket connection closing too fast. I was told I need to temporarily load data from Socket and the parse it. Here is my code:
ServerSocket listen = ...
|
I have a use case where a servlet (that has reasonably high concurrent use) makes an outgoing URLConnection to retrieve some data REST style as part of its normal server-side processing ... |
My code looks like this, this is Server code (Runnable)
public void run() {
while (true) {
try {
...
|
I'm transfering a file across a LAN(using JxtaSocket in case you heard about it) and I receive:
java.net.SocketTimeoutException: Failed to receive close ack from remote connection.
at net.jxta.socket.JxtaSocket.close(JxtaSocket.java:1046)
I would like to know what ... |
|
I'm trying to write a MIDP application which is doing lots of networking. This is all being done via HttpURLConnection (which is all this platform supports; Socket doesn't work). The main ... |
I'm using HttpURLConnection to do download of pages in Java. I forgot to release the connections and I think this was causing some problems to my system (a webcrawler.).
Now I done ... |
How do I handle properly a client Connection: close request field? As of now if I get this particular field I close the socket and wait for a following request from ... |
I learned to use Connection: close when doing 301 redirects in Java
response.setStatus(301);
response.setHeader("Location", "http://www.example.com/");
response.setHeader("Connection", "close");
Why do we do this? Why not omit the last line?
I have seen this in at least three ... |
I got a socket listener which keep listening for data. The problem now is that the client which send data will finally close the connection by itself. Based on my codes ... |
|
|
|
I have develoed a server application that can accept one connection at a time. One of the server options is that the client can request to chat with the server.If this is the case, the the server opens a chat window which uses another class 'chatserver' in order to wait for and accept connection. However, i found out that if the ... |
|
|
I'm not a javax.net expert, but it sounds to me like the host is just dropping the connection during connection setup ("handshake"). This is likely due to an overloaded server or congestion on the network somewhere between you and the server, rather than a problem with your client code. You'll probably need to work with whoever is responsible for the server ... |
I am facing a problem, when i try to communicate with finger protocol . Basically finger service closing connection when it answer my request and when i do second request with same socket so it do nothing. I check it out through ethereal that what is happening in tcp stream so basically after full fill my first request finger service send ... |
Hi guys! My serversocketchannel and socketChannels are NON-blocking! I don't know whether there is something I'm missing in java.nio package.I have implemented client -server program but my small problem is that when the client disconnects the server also dies.What do I need to close in order to prevent this(if there is any) on which side? Thanx for your in advance!! |
Hi gurus I have create a application in which i have made http conntion and at end close connection. HttpConnection con = null; InputStream in = null; xmlData = ""; try { con = (HttpConnection) Connector.open(url,3); in = con.openInputStream(); int ch; while((ch = in.read())!=-1) xmlData = xmlData + (char) ch;} catch(Exception e){ System.out.println("Error :" + e.toString()); } finally { try { ... |
We have a number of clients are sending GET requests to a servlet, which delivers to them large messages zipped up into files. The servlet has to go through quite a bit of work building these messages. If the clients have to wait too long they timeout and make their requests again. We get into a situation where the request queue ... |
|
|
Our java application fetches pages from various websites. One of our customers is finding that their machines have a very large number of TCP/IP connections in CLOSED_WAIT states that are remaining for long periods of time. We have not been able to reproduce this -- any thoughts? I have attached our basic processing code (with non-relevant code removed). We are running ... |
(a) you are closing the output stream (which you should) and it hasn't been flushed, and the receiver has stopped reading, and his socket receive buffer is full, and your socket send buffer is full, so the implicit flush() will block until the receiver reads enough to create enough space in all these buffers for the flush() to succeed. |