Doing a task like that you'd be better off using sockets.