Re: Socket exception
- From: "Bryan Phillips" <bphillips@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 3 Mar 2007 12:51:41 +0000
What value are you setting to m_sendlock? It will need to be unique for each thread.
--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
"bogma" <m.bogensperger@xxxxxxxxxxx> wrote in message news:1170153656.152377.228940@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
Hi Bryan,
the SendRaw code block is locked, so that only one thread can send.
public bool SendRaw(byte[] data, int size)
{
lock (m_sendlock)
{
if (m_socket != null)
{
if (data != null && size > 0)
{
try
{
int totalsent = 0;
do
{
int sent = m_socket.Send(data, totalsent, size - totalsent,
SocketFlags.None);
totalsent += sent;
} while (totalsent < size);
return true;
}
catch (Exception ex)
{
_log.Error("Error in CWTcpReceiver::Send:", ex);
}
}
}
}
return false;
}
.
- Prev by Date: Re: ClickOnce and Temporary/Mandatory Profiles
- Next by Date: Re: NetworkStream read throws socketexception timedout and closes s
- Previous by thread: Re: ClickOnce and Temporary/Mandatory Profiles
- Next by thread: Re: NetworkStream read throws socketexception timedout and closes s
- Index(es):
Loading