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:
Any simple code examples out there I can play with?
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.
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.
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>
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With