I am tearing my hair out over what ought to be a fairly simple thing. I am writing a client/server pair using IO::Socket. I started with the basics... I pass a command from client to server, the server parses the command, obtains a result, and passes the answer back to the client. The client receives the result and performs the appropriate action. I am happy. Moving onward, I want to perform the same actions multiple times, sending different commands from the client, but all other functionality being identical. I cannot get this to work at all. Whether I copy and paste code sequentially, or stick the code into a while loop, the server refuses to return any results to the client (or perhaps the client refuses to recieve them?). I have tried a few things, (Fcntl among them) and nothing seems to work right. What am I doing wrong? Is it even possible to go from read, to write, to read, to write on the same socket?