{ "id": "153012", "key": "TIMOB-19935", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-12T03:55:32.000+0000", "created": "2015-11-12T08:25:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "LiveView" ], "versions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "issuelinks": [ { "id": "52296", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "inwardIssue": { "id": "162263", "key": "TIMOB-23702", "fields": { "summary": "Windows: Implement Titanium.Network.Socket", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } }, { "id": "52375", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "162046", "key": "TIMOB-23678", "fields": { "summary": "Windows: Device is unable to connect to LiveView server", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-01-20T22:59:49.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "Implement {{Ti.Network.Socket.TCP}} for Windows.\r\n\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network.Socket.TCP\r\n\r\nNOTE: This is needed for LiveView\r\n\r\n*Test Case*\r\n\r\n{code}\r\nvar socket = Ti.Network.Socket.createTCP({\r\n host: 'pastebin.com', port: 80,\r\n connected: function (e) {\r\n Ti.API.info('socket connected');\r\n\r\n // receive callback\r\n Ti.Stream.pump(e.socket, function (e) {\r\n alert(e.buffer.toString());\r\n }, 1024, true);\r\n\r\n // send GET request\r\n Ti.Stream.write(socket, Ti.createBuffer({\r\n value: 'GET /raw/eF5dK0xU HTTP/1.1\\r\\nHost: pastebin.com\\r\\nConnection: close\\r\\n\\r\\n'\r\n }), function (e) {\r\n Ti.API.info('socket sent GET');\r\n });\r\n }\r\n});\r\nsocket.connect();\r\n{code}\r\n", "attachment": [ { "id": "61304", "filename": "wp_ss_20170120_0002.png", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-20T22:57:56.000+0000", "size": 134382, "mimeType": "image/png" } ], "flagged": false, "summary": "Windows: Implement Ti.Network.Socket.TCP", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 685, "state": "closed", "name": "2016 Sprint 16 SDK", "startDate": "2016-07-30T00:40:02.939Z", "endDate": "2016-08-13T00:40:00.000Z", "completeDate": "2016-08-15T08:00:33.056Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "392617", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile_windows/pull/807", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-08T15:05:44.000+0000", "updated": "2016-08-08T15:05:44.000+0000" }, { "id": "400962", "author": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "body": "Hello\r\nI need to develop a Windows Phone app that performs communication via TCP socket. Specifically, it is an extension of an already developed apps for iOS and Android platforms with Titanium SDK.\r\nSeeing that the development of the TCP part is found only in the 6.1.0.x SDK version I have updated Appcelerator SDK and Studio to the latest versions.\r\nThe TCP client implementation is present and working but I encountered some problems with sending messages, specifically it seems that the second message sent creates an error that crashes the application.\r\nI quote here the system information, the error log and test the application code.\r\nThe TCP server is a simple nodejs echo script that responds with the message received.\r\n\r\n*Platform Info*\r\nOS: Windows 10 Pro\r\nEmulator: Mobile Emulator 10.0.14393.0 720p 5 inch 1GB\r\nStudio: 4.8.0.201611011053\r\nappc 6.0.0-68\r\nTitanium SDK 6.1.0.v20161113203131\r\n\r\n*Studio Console Log*\r\n{noformat}\r\n-- Start application log -----------------------------------------------------\r\n[INFO] [TEST] open connection\r\n[INFO] [TEST] connected\r\n[INFO] : Finished launching the application\r\n[INFO] [TEST] try to send\r\n[INFO] [TEST] sent\r\n[INFO] [TEST] received: 0 0 0 0 14 a0\r\n[INFO] [TEST] try to send\r\n[ERROR] : ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : In undefined: undefined,undefined\r\n[ERROR] : Message: Uncaught Error: undefined\r\n[INFO] : Disconnected from app\r\n-- End application log -------------------------------------------------------\r\n{noformat}\r\n\r\n*Test Code*\r\n{code:java}\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar lbl = Ti.UI.createLabel({\r\n\ttext: 'TCP Test'\r\n});\r\nwin.add(lbl);\r\n\r\nwin.addEventListener('open', function()\r\n{\r\n\tvar itv;\r\n\t\r\n\tvar socket = Ti.Network.Socket.createTCP({\r\n\t\thost: '192.168.1.88',\r\n\t port: 6262,\r\n\t timeout: 3000,\r\n\t connected: function(e)\r\n\t {\r\n\t \tconsole.log(\"[TEST] connected\");\r\n\t \t\r\n\t \tTi.Stream.pump(e.socket, function(e)\r\n\t \t{\r\n\t\t\t\tif (e.bytesProcessed == -1)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Socket :: END of received message\r\n\t\t\t return;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t var res = [];\r\n\t\t\t \r\n\t\t\t for(var i = 0, len = e.buffer.length; i < len; i++)\r\n\t\t\t {\r\n\t\t\t \tres.push(e.buffer[i].toString(16));\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t console.log(\"[TEST] received: \" + res.join(\" \"));\r\n\t \t\t\r\n\t \t}, 1024, true);\r\n\t \t\r\n\t \titv = setInterval(function()\r\n\t \t{\r\n\t \t\tif(!socket)\r\n\t \t\t{\r\n\t \t\t\tclearInterval(itv);\r\n\t \t\t\t\r\n\t \t\t\treturn;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\tvar buff = Ti.createBuffer({\r\n\t\t\t\t\tlength: 6\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tbuff[0] = 0x00;\r\n\t\t\t\tbuff[1] = 0x00;\r\n\t\t\t\tbuff[2] = 0x00;\r\n\t\t\t\tbuff[3] = 0x00;\r\n\t\t\t\tbuff[4] = 0x14;\r\n\t\t\t\tbuff[5] = 0xA0;\r\n\t\t\t\t\r\n\t\t\t\tconsole.log(\"[TEST] try to send\");\r\n\t\t\t\t\r\n\t\t\t\tTi.Stream.write(socket, buff, function()\r\n\t\t\t\t{\r\n\t\t\t\t\tconsole.log('[TEST] sent');\r\n\t\t\t\t});\r\n\r\n\r\n\t \t}, 1000);\r\n\t },\r\n\t\terror: function(e)\r\n\t\t{\r\n\t\t\tclearInterval(itv);\r\n\t\t\t\r\n\t\t\tsocket = null;\r\n\t\t\t\r\n\t\t\tconsole.error(\"[TEST] socket error\");\r\n\t\t\t\r\n\t\t\tconsole.error(e);\r\n\t\t}\r\n\t});\r\n\t\r\n\tconsole.log(\"[TEST] open connection\");\r\n\t\r\n\tsocket.connect();\r\n});\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\n", "updateAuthor": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "created": "2016-11-15T08:52:27.000+0000", "updated": "2016-11-15T08:52:27.000+0000" }, { "id": "404997", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified feature with the test case provided by [~gmathews] in https://github.com/appcelerator/titanium_mobile_windows/pull/807. \r\n\r\nScreenshot shows the success message on the windows phone \r\n!wp_ss_20170120_0002.png|thumbnail!\r\n\r\nCode from the console: \r\n{code:java}\r\n-- Start application log -----------------------------------------------------\r\n[INFO] : socket connected\r\n[INFO] : socket sent GET\r\n{code}\r\n\r\n*Environment*\r\n{code:java}\r\nLumia 640 LTE (RM-1073) (OS Build 10.0.14393.693)\r\nOperating System\r\nName = Microsoft Windows 10 Pro\r\nVersion = 10.0.14393\r\nArchitecture = 64bit\r\n# CPUs = 4\r\nMemory = 17034395648\r\n \r\nNode.js\r\nNode.js Version = 4.4.4\r\nnpm Version = 2.11.3\r\n \r\nTitanium SDK\r\nSDK Version = 6.1.0.v20170118152304\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-20T22:59:28.000+0000", "updated": "2017-01-20T22:59:28.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }