C
Chad W. Taylor
Currently, I'm developing an AIM-based BOT application in Java and it
requires establishing a socket connection to their free and public
server (host: toc.oscar.aol.com, port: 9898).
About 75% of the time a connection will be successfully established
using this:
oConnection = new Socket("toc.oscar.aol.com", 9898);
25% of the time when a connection fails (timeout) is due to the server
being too slow or busy to respond to the connection request; however,
the server will eventually response within 40 to 60 seconds.
Let me go into details with my findings when attempting to connect to
the slow/busy server:
For experimental purposes, I used the telnet command (via the DOS
command prompt: "telnet toc.oscar.aol.com 9898"), the connection will
be established usually within 40 to 60 seconds.
As I said before, the BOT application is developed in a Java
environment and when attempting to establish a connection (using
Java's Socket), a timeout exception gets raised when it hits the
20-seconds mark. It tells me that the Java Socket has the timeout
defaulted to 20-seconds.
I am aware that we can define the timeout settings using Socket's
"setSoTimeout(x)" method; however, it's only good for AFTER a
connection is established.
Now, to sum up my findings – it clearly shows that the DOS' telnet
prompt has longer "wait time" before raising any exceptions. As far
as Java Socket is concerned, if a connection is not established within
20 seconds, it raises the timeout exception.
Is there a way to stretch the "wait time" or "timeout" to be longer
than 20 seconds for when a socket connection is being attempted?
Millions of thanks in advance,
Chad W. Taylor
requires establishing a socket connection to their free and public
server (host: toc.oscar.aol.com, port: 9898).
About 75% of the time a connection will be successfully established
using this:
oConnection = new Socket("toc.oscar.aol.com", 9898);
25% of the time when a connection fails (timeout) is due to the server
being too slow or busy to respond to the connection request; however,
the server will eventually response within 40 to 60 seconds.
Let me go into details with my findings when attempting to connect to
the slow/busy server:
For experimental purposes, I used the telnet command (via the DOS
command prompt: "telnet toc.oscar.aol.com 9898"), the connection will
be established usually within 40 to 60 seconds.
As I said before, the BOT application is developed in a Java
environment and when attempting to establish a connection (using
Java's Socket), a timeout exception gets raised when it hits the
20-seconds mark. It tells me that the Java Socket has the timeout
defaulted to 20-seconds.
I am aware that we can define the timeout settings using Socket's
"setSoTimeout(x)" method; however, it's only good for AFTER a
connection is established.
Now, to sum up my findings – it clearly shows that the DOS' telnet
prompt has longer "wait time" before raising any exceptions. As far
as Java Socket is concerned, if a connection is not established within
20 seconds, it raises the timeout exception.
Is there a way to stretch the "wait time" or "timeout" to be longer
than 20 seconds for when a socket connection is being attempted?
Millions of thanks in advance,
Chad W. Taylor