{"action":"closed","issue":{"url":"https://api.github.com/repos/steveohara/j2mod/issues/27","repository_url":"https://api.github.com/repos/steveohara/j2mod","labels_url":"https://api.github.com/repos/steveohara/j2mod/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/steveohara/j2mod/issues/27/comments","events_url":"https://api.github.com/repos/steveohara/j2mod/issues/27/events","html_url":"https://github.com/steveohara/j2mod/issues/27","id":165760204,"number":27,"title":"Amend TCPMasterConnection socket handling","user":{"login":"djbr-david","id":17979418,"avatar_url":"https://avatars.githubusercontent.com/u/17979418?v=3","gravatar_id":"","url":"https://api.github.com/users/djbr-david","html_url":"https://github.com/djbr-david","followers_url":"https://api.github.com/users/djbr-david/followers","following_url":"https://api.github.com/users/djbr-david/following{/other_user}","gists_url":"https://api.github.com/users/djbr-david/gists{/gist_id}","starred_url":"https://api.github.com/users/djbr-david/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djbr-david/subscriptions","organizations_url":"https://api.github.com/users/djbr-david/orgs","repos_url":"https://api.github.com/users/djbr-david/repos","events_url":"https://api.github.com/users/djbr-david/events{/privacy}","received_events_url":"https://api.github.com/users/djbr-david/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/steveohara/j2mod/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"steveohara","id":977963,"avatar_url":"https://avatars.githubusercontent.com/u/977963?v=3","gravatar_id":"","url":"https://api.github.com/users/steveohara","html_url":"https://github.com/steveohara","followers_url":"https://api.github.com/users/steveohara/followers","following_url":"https://api.github.com/users/steveohara/following{/other_user}","gists_url":"https://api.github.com/users/steveohara/gists{/gist_id}","starred_url":"https://api.github.com/users/steveohara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveohara/subscriptions","organizations_url":"https://api.github.com/users/steveohara/orgs","repos_url":"https://api.github.com/users/steveohara/repos","events_url":"https://api.github.com/users/steveohara/events{/privacy}","received_events_url":"https://api.github.com/users/steveohara/received_events","type":"User","site_admin":false},"assignees":[{"login":"steveohara","id":977963,"avatar_url":"https://avatars.githubusercontent.com/u/977963?v=3","gravatar_id":"","url":"https://api.github.com/users/steveohara","html_url":"https://github.com/steveohara","followers_url":"https://api.github.com/users/steveohara/followers","following_url":"https://api.github.com/users/steveohara/following{/other_user}","gists_url":"https://api.github.com/users/steveohara/gists{/gist_id}","starred_url":"https://api.github.com/users/steveohara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveohara/subscriptions","organizations_url":"https://api.github.com/users/steveohara/orgs","repos_url":"https://api.github.com/users/steveohara/repos","events_url":"https://api.github.com/users/steveohara/events{/privacy}","received_events_url":"https://api.github.com/users/steveohara/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-07-15T10:49:39Z","updated_at":"2016-07-15T12:33:51Z","closed_at":"2016-07-15T12:33:51Z","body":"When attempting a connection in the above class the Socket creation isn't respecting the timeout period. The result is that if a connection is attempted to an unavailable host the code hangs for 30-40s before issuing a timeout exception. The connect method should probably use:\r\n```\r\n        if (!isConnected()) {\r\n            logger.debug(\"connect()\");\r\n\r\n            socket = new Socket();\r\n            socket.setReuseAddress(true);\r\n            socket.setSoLinger(true, 1);\r\n            socket.setKeepAlive(true);\r\n            setTimeout(timeout);\r\n\r\n            socket.connect(new InetSocketAddress(address, port), timeout);\r\n\r\n            prepareTransport(useRtuOverTcp);\r\n\r\n            connected = true;\r\n        }\r\n```\r\nwhich does respect the timeout."}}
{"actor":{"display_login":"steveohara"}}