TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2]

Reviewers: DavidL

Changelog:
- Implement listen, accept methods
- Implement state, listenQueueSize, connected, accepted, error properties
- Handling exception cases.

NOTE: [Client part] Use local tcp server to check the functionality, with both ip address and hostname. Was used TCPMonitor plugin for Eclipse.
NOTE: [Server part] Use hostname and ip address of simulator. Connect to it using telnet.

NOTE: Some parts not fully tested yet and not fully implemented.

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,
	connected : function(e) {
            Ti.API.info('Client socket connected! Socket: ' + e.socket.port);
    }
});

socket.connect();
*/

//Create a socket and listen for incoming connections
var listenSocket = Ti.Network.Socket.createTCP({
	// Simulator IP address
    host : '192.168.226.134',
    port : 40404
});

// Starts the socket listening for connections, does not accept them
listenSocket.listen();
Ti.API.info("Listening now...");

// Tells socket to accept the next inbound connection. listenSocket.accepted gets
// called when a connection is accepted via accept()
Ti.API.info("Calling accept.");
listenSocket.accept({
    timeout : 10000
});

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

button.addEventListener('click',function(e)
{
   alert('Hello');
});

win1.add(button);

// open window
win1.open();
TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2] ver2

Changelog:
- Address comments.
- Update apidoc.

NOTE: [Client part] Use local tcp server to check the functionality, with both ip address and hostname. Was used TCPMonitor plugin for Eclipse.
NOTE: [Server part] Use hostname and ip address of simulator. Connect to it using telnet.

Test cases:
- Use the snippets attached to JIRA to test current functionality.
TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2] ver3

Changelog:
- Address comments.
- Code refactoring.

NOTE: [Client part] Use local tcp server to check the functionality, with both ip address and hostname. Was used TCPMonitor plugin for Eclipse.
NOTE: [Server part] Use hostname and ip address of simulator. Connect to it using telnet.

Test cases:
- Use the snippets attached to JIRA to test current functionality.
TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2] ver4

Changelog:
- Address comments.
- Code refactoring.
- Implement write, read methods.

NOTE: [Client part] Use local tcp server to check the functionality, with both ip address and hostname. Was used TCPMonitor plugin for Eclipse.
NOTE: [Server part] Use hostname and ip address of simulator. Connect to it using telnet.

Test cases:
- Use the snippets attached to JIRA to test current functionality.
- app.js updated.
TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2] ver5

Changelog:
- Address comments.

NOTE: [Client part] Use local tcp server to check the functionality, with both ip address and hostname. Was used TCPMonitor plugin for Eclipse.
NOTE: [Server part] Use hostname and ip address of simulator. Connect to it using telnet.

Test cases:
- Use the snippets attached to JIRA to test current functionality.
- app.js updated.
TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2] ver6

Changelog:
- Address comments.

NOTE: [Client part] Use local tcp server to check the functionality, with both ip address and hostname. Was used TCPMonitor plugin for Eclipse.
NOTE: [Server part] Use hostname and ip address of simulator. Connect to it using telnet.

Test cases:
- Use the snippets attached to JIRA to test current functionality.
- app.js updated.
Merge pull request #134 from alexandergalstyan/networkBranchPart2

TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part2]