Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saturngod/simplesocketchat
Node.js TCP socket and iOS SDK
https://github.com/saturngod/simplesocketchat
Last synced: 2 months ago
JSON representation
Node.js TCP socket and iOS SDK
- Host: GitHub
- URL: https://github.com/saturngod/simplesocketchat
- Owner: saturngod
- Created: 2012-11-15T16:03:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-14T02:37:24.000Z (over 11 years ago)
- Last Synced: 2024-04-08T17:02:07.564Z (9 months ago)
- Language: Objective-C
- Size: 209 KB
- Stars: 31
- Watchers: 5
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
TCP chat with iOS using nodejs tcp socket. This is a demo app to show how to connect socket with iOS.
## Run server
Before running , you need to change IP address in **server/socket.js**.
Currently I am using 192.168.1.95 and port 5100. You can change at **server/socket.js**
node server/socket.js
## How to useAllocate the socket server with HOST and Port
_chatSocket = [[tcpSocketChat alloc] initWithDelegate:self AndSocketHost:@"192.168.1.49" AndPort:5100];
Send data[self.chatSocket sendMessage:textField.text];
Receive Data Delegate
-(void)receivedMessage:(NSString *)data
{
self.logView.text = [self.logView.text stringByAppendingFormat:@"%@",data];
[self.logView scrollRangeToVisible:NSMakeRange([self.logView.text length], 0)];
}Disconnect
if([_chatSocket isConnected]) {
[_chatSocket disconnect];
}Reconnect
if([_chatSocket isDisconnected])
{
[_chatSocket reconnect];
}## Socket Server Code From
[https://gist.github.com/707146](https://gist.github.com/707146)
## Usages Library
[https://github.com/robbiehanson/CocoaAsyncSocket](https://github.com/robbiehanson/CocoaAsyncSocket)
## Demo
[http://www.youtube.com/watch?v=rutDFYw7GFk&feature=youtu.be](http://www.youtube.com/watch?v=rutDFYw7GFk&feature=youtu.be)