{ "id": "87079", "key": "TIMOB-8014", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-19T17:51:57.000+0000", "created": "2012-02-28T03:16:29.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_network", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-04-19T17:51:57.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When the following app run on Android, it outputs \">>Socket error:Unable to connect, IO error\" in TextArea after the 10 seconds since the button pressed.\r\nOn the other hand, on iPhone, it output nothing after 10 seconds.\r\nAnd it output \">>Socket error:Attempt to connect to host timed out\" after 10 seconds, by replacing \"timeout: 10000\" to \"timeout: 10\".\r\nIt seems the unit of timeout property in iOS is second, besides the API Doc explicitly describe \"in milliseconds\".\r\n\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"#eee\",\r\n\tlayout: \"vertical\"\r\n});\r\nvar textarea = Ti.UI.createTextArea({\r\n\tvalue: \"\",\r\n\tleft: 0,\r\n\ttop: 0,\r\n\twidth: 320,\r\n\theight: 200\r\n});\r\nvar button = Ti.UI.createButton({\r\n\ttitle: \"Connect\",\r\n\ttop: 20,\r\n\theight: 50,\r\n\twidth: 100\r\n});\r\nwin.add(textarea);\r\nwin.add(button);\r\n\r\nvar buffer = Ti.createBuffer();\r\nvar socket = Ti.Network.Socket.createTCP({\r\n\thost: \"192.168.100.200\",\r\n\tport: 50000,\r\n\ttimeout: 10000,\r\n\tconnected: function(e) {\r\n\t\ttextarea.value += \">>Connected\\n\";\r\n\t\tsocket.read(buffer);\r\n\t\ttextarea.value += buffer + \"\\n\";\r\n\t},\r\n\terror: function(e) {\r\n\t\ttextarea.value += \">>Socket error:\" + e.error + \"\\n\";\r\n\t}\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n\tsocket.connect();\r\n});\r\n\r\nwin.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.Network.Socket.TCP \"timeout\" property's unit is seconds and not milli-second", "creator": { "name": "sakira09", "key": "sakira09", "displayName": "Akira Suzuki", "active": true, "timeZone": "Asia/Tokyo" }, "subtasks": [], "reporter": { "name": "sakira09", "key": "sakira09", "displayName": "Akira Suzuki", "active": true, "timeZone": "Asia/Tokyo" }, "environment": "iPhone Simulator (iOS 5), iPod touch 3rd generation (iOS 4.3.3)\r\nTitanium Mobile SDK 1.9.0 on Mac OS X 10.6 (iMac 27inch)", "comment": { "comments": [ { "id": "184469", "author": { "name": "sakira09", "key": "sakira09", "displayName": "Akira Suzuki", "active": true, "timeZone": "Asia/Tokyo" }, "body": "I assume that the host \"192.168.100.200\" does NOT exist. If some server is listening on 192.168.100.200:50000, it works as I desire.", "updateAuthor": { "name": "sakira09", "key": "sakira09", "displayName": "Akira Suzuki", "active": true, "timeZone": "Asia/Tokyo" }, "created": "2012-02-28T03:20:32.000+0000", "updated": "2012-02-28T03:20:32.000+0000" }, { "id": "186638", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Akira's pull request for this issue is here:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/1427", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-15T11:19:50.000+0000", "updated": "2012-03-15T11:19:50.000+0000" }, { "id": "187211", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested on iPhone 3gs 4.3.5 with 2.0.0.v20120319003254", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T15:00:35.000+0000", "updated": "2012-03-19T15:00:35.000+0000" }, { "id": "191966", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-19T17:51:39.000+0000", "updated": "2012-04-19T17:51:39.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }