Category Archives: Coding

All kinds of Programming.

Udp socket programming in Java

By | September 15, 2012

Datagram sockets UDP sockets can be used in java with the DatagramSocket class. Server Let code a simple udp server that listens on a certain port number. Run this program by typing the following at terminal/command line $ javac && java udp_server Server socket created. Waiting for incoming data… Now the udp server is… Read More »

Receive full data with recv socket function in C

By | September 8, 2012

recv The recv function is used to receive data on a socket. For example here is the code to fetch the home page of The output might be something like this $ gcc simple_client.c && ./a.out Connected Data Send Reply received HTTP/1.1 200 OK Cache-Control: no-cache, no-store Pragma: no-cache Content-Type: text/html; charset=utf-8 Vary: Accept-Encoding… Read More »