Hi everyone, i'm trying to do a client/server app. I have one trouble: when i send a message to server, i want to receive its answer inmediately. But also, i need to keep socket listening for another messages server can send to client without client sending a message first. That means that in a process i have this code:
Code:
   Method()

      MainSocket.Send()               'Send data

      MainSocket.Receive()           'Receive server answer inmediately

      ...

   End Method   


   MethodInAnotherProcess()

      MainSocket.Receive()          'Block process until new data has arrived

      ...

   End MethodInAnotherProcess
So, when i do that, it throws a SocketException. I guess that i can't call Socket.Receive method when it has called already in another process. So, how can i do that? do i need to use two sockets? one for one task i require and another one for other task?. I would be really apreciated if you can help me guys. Thanks!.
Regards.