Tcp Ip Send Receive Server Program

Requirements:
A server program should read a file and send the message to the client . if the file is not there, then switch to the receive part of the same program and receive any messages from the socket. If no messages to receive then switch to send part of the program to send any messages. This should work continuously.

How to do this? Steps to do it will be enough.

u should use the select() if using c (coz i had worked with it) .. non blocking select will ensure continual listening for incoming requests... as and when req come in.. put them in a data structure and then use ur thread to read that file.. just call those functions in the order required by u... i hope this helps u... and do lemme know if i have gone wrong somewhere...(for the others!)

ues Xscan get the hole or others tool.