i wish to create a terminal emulator using c language. instead of using serial cable as a medium, i would like to use nic, therefor sending data in the form of packets. how can i do this? can somebody help me?
i wish to create a terminal emulator using c language. instead of using serial cable as a medium, i would like to use nic, therefor sending data in the form of packets. how can i do this? can somebody help me?
If 'nic' = network interface card ?
Then communication using TCP is simple to do. The packet handling is done by TCP.
These are the basic steps:
To send - create a socket, connect, send to socket then close Socket.
To receive - create a socket, listen on the socket then accept and receive
in a loop.
Lookup the following functions:
winsock2.h
// send program
WSAStartup();
inet_addr();
gethostbyaddr();
socket();
connect();
send();
closesocket();
WSACleanup();
// receive program
WSAStartup();
socket();
bind();
listen();
accept();
recv();
WSACleanup();
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]