Saturday, November 8, 2008

A simple TCP/IP chat application

rough code in C :

client.c
sock1 = socket(..);
connect();
while(1)
{
printf("enter your message");
fgets();
write(sock1);
read();
}

server.c
socket();bind();listen;
sock2=accept();
while(1){
read();
printf("enter your message");
fgets();
write();
}

No comments:

Blog Archive