Macadamian/titanium_mobile — pull request #132 by alexandergalstyan (2012-08-14 15:25:04+00:00)
Title: TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part1]

Reviewers: DavidL

Changelog:
- Added NativeTCPSocketObject, TiNetwork, TiSocketObject, TiTCPSocketObject classes
- Added Network.Socket constants
- Implemented port, host properties from Network.Socket.TCP
- Implemented connect, close methods from Network.Socket.TCP
- Updated apidoc

Test cases:
- Use the snippets attached to JIRA to test current functionality.

// Network.Socket.TCP snippet

var win1 = Titanium.UI.createWindow({
backgroundColor:'#F00'
});

var socket = Ti.Network.Socket.createTCP({
host: 'alexg',
port: 8080
});

socket.connect();

var button = Titanium.UI.createButton({
title: 'Stop',
top: 10,
width: 200,
height: 100
});

button.addEventListener('click',function(e)
{
socket.close();
});

win1.add(button);

win1.open();