Hi, I wrote a simple Server/Client chat program. But there is a problem Server always write after client writes something and client always write after server writes something. Because in my while loop first takes from other part(Server or Client) then write. But i want to write and read at the same time like Msn messenger. So I wrote this code. When i run the server part, server waits for client but when client comes, there is an error like this:
Hi, the socket is closed because in the finally block(in main method) you are closing the socket. When you start the Read and Write, the main method follow his execution and close the socket in the finally block. The program is alive because the Write thread isn't dead. [ June 09, 2007: Message edited by: Miguel Ivan Gutierrez ]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Chat At Server Part Both write and read at the same time?