February 22, 2015

Command to know the incoming network connections,transmitting data to server in unix

Command  to know the incoming network connections in unix 

 to know a command which would help knowing the incoming network connections through(from & to) different ip-address:ports

netstat -anp | grep "port" | grep "process"

Transmitting data to server through code in linux

int no_of_bytes_to_send;
char* buffer[100];
no_of_bytes_to_send=sizeof(buffer);
while(no_of_bytes_to_send>0)
{
int byte_send = send(sd,buffer,no_of_bytes_to_send);
no_of_bytes_to_send = no_of_bytes_to_send - byte_send;
buffer+=byte_send;


}