D
dream machine
Hi all,
I'm try to check if the one client socket is really connected at my SocketServer .
I build Client Socket with BeginAccept() ,
and I want to receive data with BegenReceive() call !
The BeginReceive and BeginAccept work very nice .
<Code type="C#">
try
{
int byte_available = socket_client.Available();
socket_client.BeginReceive(par1,par2,par3,parN....);
}
catch (SocketException e)
{
Console.WriteLine("TheSocket Was Disconnected From server");
}
</Code>
The problem is that if my client was disconnected from server,
the .Available property don't build the SocketException :-(
For this reason the BeginReceive is called :-(
- what happened if the Client was disconnected AFTER the BeginReceive Call ?
I have try to check the .Available property before the .EndReceive() method ,
in this way I can do double check if the client was disconnected from server.
But the .Available return 0, always and the .EndReceive is Called !
Can anyone can explain me this problem ?
dm
I'm try to check if the one client socket is really connected at my SocketServer .
I build Client Socket with BeginAccept() ,
and I want to receive data with BegenReceive() call !
The BeginReceive and BeginAccept work very nice .
<Code type="C#">
try
{
int byte_available = socket_client.Available();
socket_client.BeginReceive(par1,par2,par3,parN....);
}
catch (SocketException e)
{
Console.WriteLine("TheSocket Was Disconnected From server");
}
</Code>
The problem is that if my client was disconnected from server,
the .Available property don't build the SocketException :-(
For this reason the BeginReceive is called :-(
- what happened if the Client was disconnected AFTER the BeginReceive Call ?
I have try to check the .Available property before the .EndReceive() method ,
in this way I can do double check if the client was disconnected from server.
But the .Available return 0, always and the .EndReceive is Called !
Can anyone can explain me this problem ?
dm