You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Julien Vermillard (JIRA)" <ji...@apache.org> on 2005/03/31 17:53:17 UTC
[jira] Created: (DIRMINA-13) SocketConnector connection timeout not respected
SocketConnector connection timeout not respected
------------------------------------------------
Key: DIRMINA-13
URL: http://issues.apache.org/jira/browse/DIRMINA-13
Project: Directory MINA
Type: Bug
Environment: In a client code using MINA SocketConnector.
After a connection closed due to IDLEing ( I have unplugged the network cable of the server), my client try to reconnect every 5 seconds to the server with this intruction :
session = connector.connect(new InetSocketAddress( hostname, port), 5, protocolProvider);
the connection try take more than 5 secondes for fail, something like 1 minute for throw an IOException.
Reporter: Julien Vermillard
Assigned to: Trustin Lee
System : AMD64 Linux Debian, Sun JRE 1.5.0_01
MINA from CVS (today checkout)
code SNIPET
private final class PollingThread extends Thread {
private final ProtocolProvider protocolProvider;
private final IoProtocolConnector connector;
private final int TIMEOUT;
private PollingThread(ProtocolProvider protocolProvider, IoProtocolConnector connector, int TIMEOUT) {
super();
this.protocolProvider = protocolProvider;
this.connector = connector;
this.TIMEOUT = TIMEOUT;
}
public void run() {
while (run) {
if ((session == null || !session.isConnected()) && run) {
// try to reconnect
logger.info("Try reconnection");
// session.close();
try {
session = connector.connect(new InetSocketAddress(
hostname, port), TIMEOUT, protocolProvider);
logger.info("Reconnection sucess");
} catch (IOException e) {
// it's not reconnecting
logger.info("Reconnection failed");
try {
// sleep 5 seconds
Thread.sleep(5000);
} catch (InterruptedException e1) {
logger.error("Sleep interrupted", e);
}
}
}
if(session!=null)
session.write(new ModbusMessage(0, 0, 1, 1, new byte[] { 0,
0, 0, (byte) getInputsCount() }));
try {
Thread.sleep(getPollingSpeed());
} catch (InterruptedException e) {
logger.error("Sleep interrupted", e);
}
}
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Resolved: (DIRMINA-13) SocketConnector connection timeout not respected
Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-13?page=history ]
Trustin Lee resolved DIRMINA-13:
--------------------------------
Resolution: Fixed
Oops, I forgot to give timeout to selector.select(). I checked in the fix now. :)
> SocketConnector connection timeout not respected
> ------------------------------------------------
>
> Key: DIRMINA-13
> URL: http://issues.apache.org/jira/browse/DIRMINA-13
> Project: Directory MINA
> Type: Bug
> Environment: In a client code using MINA SocketConnector.
> After a connection closed due to IDLEing ( I have unplugged the network cable of the server), my client try to reconnect every 5 seconds to the server with this intruction :
> session = connector.connect(new InetSocketAddress( hostname, port), 5, protocolProvider);
> the connection try take more than 5 secondes for fail, something like 1 minute for throw an IOException.
> Reporter: Julien Vermillard
> Assignee: Trustin Lee
>
> System : AMD64 Linux Debian, Sun JRE 1.5.0_01
> MINA from CVS (today checkout)
> code SNIPET
> private final class PollingThread extends Thread {
> private final ProtocolProvider protocolProvider;
> private final IoProtocolConnector connector;
> private final int TIMEOUT;
> private PollingThread(ProtocolProvider protocolProvider, IoProtocolConnector connector, int TIMEOUT) {
> super();
> this.protocolProvider = protocolProvider;
> this.connector = connector;
> this.TIMEOUT = TIMEOUT;
> }
> public void run() {
> while (run) {
> if ((session == null || !session.isConnected()) && run) {
> // try to reconnect
> logger.info("Try reconnection");
> // session.close();
> try {
> session = connector.connect(new InetSocketAddress(
> hostname, port), TIMEOUT, protocolProvider);
> logger.info("Reconnection sucess");
> } catch (IOException e) {
> // it's not reconnecting
> logger.info("Reconnection failed");
> try {
> // sleep 5 seconds
> Thread.sleep(5000);
> } catch (InterruptedException e1) {
> logger.error("Sleep interrupted", e);
> }
> }
> }
> if(session!=null)
> session.write(new ModbusMessage(0, 0, 1, 1, new byte[] { 0,
> 0, 0, (byte) getInputsCount() }));
> try {
> Thread.sleep(getPollingSpeed());
> } catch (InterruptedException e) {
> logger.error("Sleep interrupted", e);
> }
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Closed: (DIRMINA-13) SocketConnector connection timeout not respected
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-13?page=all ]
Julien Vermillard closed DIRMINA-13:
------------------------------------
> SocketConnector connection timeout not respected
> ------------------------------------------------
>
> Key: DIRMINA-13
> URL: http://issues.apache.org/jira/browse/DIRMINA-13
> Project: Directory MINA
> Type: Bug
> Environment: In a client code using MINA SocketConnector.
> After a connection closed due to IDLEing ( I have unplugged the network cable of the server), my client try to reconnect every 5 seconds to the server with this intruction :
> session = connector.connect(new InetSocketAddress( hostname, port), 5, protocolProvider);
> the connection try take more than 5 secondes for fail, something like 1 minute for throw an IOException.
> Reporter: Julien Vermillard
> Assignee: Trustin Lee
>
> System : AMD64 Linux Debian, Sun JRE 1.5.0_01
> MINA from CVS (today checkout)
> code SNIPET
> private final class PollingThread extends Thread {
> private final ProtocolProvider protocolProvider;
> private final IoProtocolConnector connector;
> private final int TIMEOUT;
> private PollingThread(ProtocolProvider protocolProvider, IoProtocolConnector connector, int TIMEOUT) {
> super();
> this.protocolProvider = protocolProvider;
> this.connector = connector;
> this.TIMEOUT = TIMEOUT;
> }
> public void run() {
> while (run) {
> if ((session == null || !session.isConnected()) && run) {
> // try to reconnect
> logger.info("Try reconnection");
> // session.close();
> try {
> session = connector.connect(new InetSocketAddress(
> hostname, port), TIMEOUT, protocolProvider);
> logger.info("Reconnection sucess");
> } catch (IOException e) {
> // it's not reconnecting
> logger.info("Reconnection failed");
> try {
> // sleep 5 seconds
> Thread.sleep(5000);
> } catch (InterruptedException e1) {
> logger.error("Sleep interrupted", e);
> }
> }
> }
> if(session!=null)
> session.write(new ModbusMessage(0, 0, 1, 1, new byte[] { 0,
> 0, 0, (byte) getInputsCount() }));
> try {
> Thread.sleep(getPollingSpeed());
> } catch (InterruptedException e) {
> logger.error("Sleep interrupted", e);
> }
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira