469,282 Members | 2,045 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Socket Exception Please Help....

Rik
Hello Experts,
I have a communication server in VB.NET.
It was working fine from last 6 months, but now start giving error message
like that.

21-03-2005 07:58:27 DoListenSystem.Net.Sockets.SocketException: A blocking
operation was interrupted by a call to WSACancelBlockingCall
at System.Net.Sockets.Socket.Accept()
at System.Net.Sockets.TcpListener.AcceptTcpClient()
at ProjectCommServer.CommServer.DoListen()

When I launched it I got that error message in my error log file..
Can anybody tell me what sort of that error is? and why is that keep coming
in now?

Thanks in Advance....
Please help....

Rik
Nov 21 '05 #1
6 4037
Rik
No Body is here to help me or Guide me please??

Rik

"Rik" <ri********@yahoo.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
Hello Experts,
I have a communication server in VB.NET.
It was working fine from last 6 months, but now start giving error message
like that.

21-03-2005 07:58:27 DoListenSystem.Net.Sockets.SocketException: A blocking
operation was interrupted by a call to WSACancelBlockingCall
at System.Net.Sockets.Socket.Accept()
at System.Net.Sockets.TcpListener.AcceptTcpClient()
at ProjectCommServer.CommServer.DoListen()

When I launched it I got that error message in my error log file..
Can anybody tell me what sort of that error is? and why is that keep
coming in now?

Thanks in Advance....
Please help....

Rik

Nov 21 '05 #2
In article <ej**************@TK2MSFTNGP14.phx.gbl>, Rik wrote:
No Body is here to help me or Guide me please??

Rik

"Rik" <ri********@yahoo.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
Hello Experts,
I have a communication server in VB.NET.
It was working fine from last 6 months, but now start giving error message
like that.

21-03-2005 07:58:27 DoListenSystem.Net.Sockets.SocketException: A blocking
operation was interrupted by a call to WSACancelBlockingCall
at System.Net.Sockets.Socket.Accept()
at System.Net.Sockets.TcpListener.AcceptTcpClient()
at ProjectCommServer.CommServer.DoListen()

When I launched it I got that error message in my error log file..
Can anybody tell me what sort of that error is? and why is that keep
coming in now?

Thanks in Advance....
Please help....

Rik



I've never seen that error... Can you post some relavent code?

--
Tom Shelton [MVP]
Nov 21 '05 #3
Rik

Hi Tom,
Thanks for your feed back.
here is code where I am getting that error message.

Private Sub DoListen()

Try

' Listen for new connections.

listener = New TcpListener(System.Net.IPAddress.Any, PORT_NUM)

listener.Start()

Do

' Create a new user connection using TcpClient returned by

' TcpListener.AcceptTcpClient()

Dim client As New UserConnection(listener.AcceptTcpClient)

' Create an event handler to allow the UserConnection to communicate

' with the window.

AddHandler client.LineReceived, AddressOf OnLineReceived

UpdateStatus("(" & Format(DateTime.Now, "dd-MM-yyyy HH:mm:ss") & ")." & "New
Connection Found: Waiting for Log-in")

Loop Until False

Catch ex As Exception

Call WritetoTextFileMain("DoListen" & ex.ToString)

End Try

End Sub

*When ever I start my Application , I got that Error message...

Please help meeeeee

Rik


"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:OC**************@TK2MSFTNGP12.phx.gbl...
In article <ej**************@TK2MSFTNGP14.phx.gbl>, Rik wrote:
No Body is here to help me or Guide me please??

Rik

"Rik" <ri********@yahoo.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
Hello Experts,
I have a communication server in VB.NET.
It was working fine from last 6 months, but now start giving error
message
like that.

21-03-2005 07:58:27 DoListenSystem.Net.Sockets.SocketException: A
blocking
operation was interrupted by a call to WSACancelBlockingCall
at System.Net.Sockets.Socket.Accept()
at System.Net.Sockets.TcpListener.AcceptTcpClient()
at ProjectCommServer.CommServer.DoListen()

When I launched it I got that error message in my error log file..
Can anybody tell me what sort of that error is? and why is that keep
coming in now?

Thanks in Advance....
Please help....

Rik



I've never seen that error... Can you post some relavent code?

--
Tom Shelton [MVP]

Nov 21 '05 #4
On 2005-03-21, Rik <ri********@yahoo.com> wrote:

Hi Tom,
Thanks for your feed back.
here is code where I am getting that error message.

Private Sub DoListen()

Try

' Listen for new connections.

listener = New TcpListener(System.Net.IPAddress.Any, PORT_NUM)

listener.Start()

Do

' Create a new user connection using TcpClient returned by

' TcpListener.AcceptTcpClient()

Dim client As New UserConnection(listener.AcceptTcpClient)

' Create an event handler to allow the UserConnection to communicate

' with the window.

AddHandler client.LineReceived, AddressOf OnLineReceived

UpdateStatus("(" & Format(DateTime.Now, "dd-MM-yyyy HH:mm:ss") & ")." & "New
Connection Found: Waiting for Log-in")

Loop Until False

Catch ex As Exception

Call WritetoTextFileMain("DoListen" & ex.ToString)

End Try

End Sub

*When ever I start my Application , I got that Error message...

Please help meeeeee

Rik


Hmmm, nothing jumps out at me as obviously wrong here... Have you
debuged this and found exactly what line is throwing the exception?
Most likely it's the listener.AcceptTcpClient line.

I don't normally use the tcpclient or tcplistner stuff. I almost always
use the the System.Net.Socket class using the async mode of operation.
I just saw you asking for help, so I thought I'd take a stab at it :)

--
Tom Shelton [MVP]
Nov 21 '05 #5
Rik
Hi Tom,

I think I figured out why this error is appearing.
I am also using the Async menthod, but I am Locking the Stream to avoid any
conflictions.
That error only appears when I lauch the Two Instances of the same
aplication but on the differant ports, they both try to Lock the Streams at
the same time, which are causing a conflict.
Now what I did that I am running the Two application with single AppDomain,
I mean running a second instance from the Main AppDomian thread.
Which helps me to keep the second comms request in the main threading pool
as well.

are you suggesting that TCPClients are not best as compared to
System.net.sockets?

Cheers for your help

Rik

"Tom Shelton" <ts******@YOUKNOWTHEDRILLcomcast.net> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
On 2005-03-21, Rik <ri********@yahoo.com> wrote:

Hi Tom,
Thanks for your feed back.
here is code where I am getting that error message.

Private Sub DoListen()

Try

' Listen for new connections.

listener = New TcpListener(System.Net.IPAddress.Any, PORT_NUM)

listener.Start()

Do

' Create a new user connection using TcpClient returned by

' TcpListener.AcceptTcpClient()

Dim client As New UserConnection(listener.AcceptTcpClient)

' Create an event handler to allow the UserConnection to communicate

' with the window.

AddHandler client.LineReceived, AddressOf OnLineReceived

UpdateStatus("(" & Format(DateTime.Now, "dd-MM-yyyy HH:mm:ss") & ")." &
"New
Connection Found: Waiting for Log-in")

Loop Until False

Catch ex As Exception

Call WritetoTextFileMain("DoListen" & ex.ToString)

End Try

End Sub

*When ever I start my Application , I got that Error message...

Please help meeeeee

Rik


Hmmm, nothing jumps out at me as obviously wrong here... Have you
debuged this and found exactly what line is throwing the exception?
Most likely it's the listener.AcceptTcpClient line.

I don't normally use the tcpclient or tcplistner stuff. I almost always
use the the System.Net.Socket class using the async mode of operation.
I just saw you asking for help, so I thought I'd take a stab at it :)

--
Tom Shelton [MVP]

Nov 21 '05 #6
In article <en**************@TK2MSFTNGP14.phx.gbl>, Rik wrote:
Hi Tom,

I think I figured out why this error is appearing.
I am also using the Async menthod, but I am Locking the Stream to avoid any
conflictions.
That error only appears when I lauch the Two Instances of the same
aplication but on the differant ports, they both try to Lock the Streams at
the same time, which are causing a conflict.
Now what I did that I am running the Two application with single AppDomain,
I mean running a second instance from the Main AppDomian thread.
Which helps me to keep the second comms request in the main threading pool
as well.

are you suggesting that TCPClients are not best as compared to
System.net.sockets?

No... I'm not really suggesting anything. I just prefere to use the raw
socket class. It's closer to the way I am used to doing things. Even
if VB6 I never used to use 3rd party socket components or the winsock
control. I used to use the winsock32 api... The socket class is a
fairly thin wrapper :)

Cheers for your help


You're welcome - though I didn't do anything really :)

--
Tom Shelton [MVP]
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Naveen Mukkelli | last post: by
1 post views Thread by Chakra Venkatesan | last post: by
1 post views Thread by A Hirsi | last post: by
4 posts views Thread by anonymous_c | last post: by
reply views Thread by Eternal Snow | last post: by
5 posts views Thread by ranishobha21 | last post: by
reply views Thread by sa6113 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.