I am attempting to write a simple TCP server, and i want to be able to both read and write to the client.
Can I use fdopen twice on the client file descriptor: once for read and once for write?
ie can I do this:
Thanks,Code:fromAddrSize = sizeof(struct sockaddr_in); /* Block Waiting for connection */ fd = accept(fdServer, (struct sockaddr*)&fromAddr, &fromAddrSize); toClient = fdopen(fd, "w"); fromClient = fdopen(fd, "r");
Luke