Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone socket program

I want to create an extremely simple iPhone program that will open a telnet session on a lan-connected device and send a sequence of keystrokes. Most of the code I've seen for sockets is overwhelming and vast overkill for what I want to do:

  1. open telnet socket to IP address
  2. send ascii keystrokes

Any simple code examples out there I can play with?

like image 219
Alan Avatar asked Jul 04 '09 21:07

Alan


People also ask

What is socket programming in iOS?

Socket.IO is a JavaScript library for real-time web applications(Instant messengers, Push Notifications, Online Gaming). Sockets have traditionally been the solution around which most real-time systems are architected, providing a bi-directional communication channel between a client and a server.

What are sockets in software?

A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent to.

What is CFSocket?

A CFSocket is a communications channel implemented with a BSD socket. For most uses of this API, you will need to include three headers: #import <CoreFoundation/CoreFoundation.h> #include <sys/socket.h> #include <netinet/in.h>

What is socket programming in mobile application development?

Socket programming is a method of communicating between two devices connected to the same network. Two sockets, one on the client and one on the server, interact. An IP address plus a port make up a socket's address. Over the specified port, the server application begins to listen to clients.


3 Answers

I'd suggest you check out the Asyncsocket project:

It makes socket programming really easy; no messing with threads yourself and things happen asynchronously without much fuss.

I think there is a sample project with a client/server to get you started.

like image 156
Andrew Pouliot Avatar answered Sep 28 '22 05:09

Andrew Pouliot


Do yourself a favor: go read at least first 6 chapters of this Steven's book in which you can find plenty of simple examples and many advices how to avoid common pitfalls with network programming. Without doing that you will end with a buggy, slow and incomplete client.

like image 22
Alexander Gromnitsky Avatar answered Oct 01 '22 05:10

Alexander Gromnitsky


Go through this you will have to get basic idea of socket programming

http://ichuiphonedev.blogspot.in/2012/07/a-basic-idea-of-socket-programming-in.html

like image 37
ios6 Avatar answered Sep 29 '22 05:09

ios6