PDA

View Full Version : How to communicate between two PC using Socket Programming?


equissher
08-12-2007, 05:46 AM
The communication between two PC are using LAN cable and at least can send 'HELLO' to the other PC.

ladeehwk
08-12-2007, 01:55 PM
Since the are many different kinds of computers, running different OS's, connected by different physical links there needs to be some standard way for these computers to talk to each other. IP or Internet Protocol is what is called a "network layer" communication protocol. It's at this layer that your computer or device has its IP address. At a level above the "network layer" we have the "transport layer". TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two examples of "network layer" protocols. TCP and UDP are built on top of IP, adding features like checksums or resends. For the rest of the information please go to http://www.mech.northwestern.edu/courses/433/Writeups/IP_communication/NetworkTutorial.htm

slowpoke_115
08-12-2007, 02:45 PM
This is a small python script i wrotefrom socket import *#define variablesipadd = 'IPHERE'Port = PORTHEREmessage = "Message here"#setup connectionclientsocket = socket(AF_INET, SOCK_STREAM)clientsocket.connect((ipadd, Port))#send messageclientsocket.send(message)