Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part1] #132

Merged

Conversation

alexandergalstyan
Copy link

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

NOTE: Use local tcp server to check the functionality, wtih both ip address and hostname. Was used TCPMonitor plugin for Eclipse.

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();

…ocket.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();
@@ -98,6 +98,7 @@ methods:
type: Dictionary<Titanium.Network.TCPSocket>
- name: decodeURIComponent
summary: Returns a decoded version of a URI encoded value.
platforms: [android, iphone, ipad, mobileweb]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indents, same for the rest of the file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, unregisterForPushNotifications looks like it's for iOS only, can you please check with Appcelerator?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dlifshitz-maca
Copy link

Approved with comments. The Appcelerator questions can be addressed in the next PR.

…ocket.TCP [part1] ver2

Reviewers: DavidL

Changelog:
- Address comments
- Updated apidoc

NOTE: Use local tcp server to check the functionality, wtih both ip address and hostname. Was used TCPMonitor plugin for Eclipse.

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();
@alexandergalstyan
Copy link
Author

Updated

alexandergalstyan added a commit that referenced this pull request Aug 16, 2012
TIMOB-10137: BlackBerry: Implement Ti.Network.Socket and Ti.Network.Socket.TCP [part1]
@alexandergalstyan alexandergalstyan merged commit 9ddeaad into Macadamian:blackberry Aug 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants