472,330 Members | 1,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,330 software developers and data experts.

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 4157
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Naveen Mukkelli | last post by:
Hi, I'm writing a client/server app. I want to run my server on "Windows Server 2003" PC. This PC has two network cards. 1 for Internet and...
1
by: Chakra Venkatesan | last post by:
Hi, I am getting an exception in my ASP.NET application as shown below, at System.Threading.WaitHandle.WaitOneNative(IntPtr waitHandle, UInt32...
1
by: A Hirsi | last post by:
I have created a vb .net program as a service that is using a simple ftpclient to connect to a remote server and check the status of a file for...
4
by: anonymous_c | last post by:
Hey guys. I'm creating a file transfer app. Anyways, I'm using this code... SERVER <code>Dim Hostname As String = Dns.GetHostName Dim IP As...
0
by: Eternal Snow | last post by:
Hello. I have some trouble. Please look at this code below written in VB2005 (.net 2 50727). Sub Main() Dim osck As Net.Sockets.Socket Dim...
5
by: ranishobha21 | last post by:
Dear all, i want to send some unix commands to remote unix machine in france through php.i am using socket communication in php, i have written ...
3
by: doc | last post by:
What will a flash xml client socket connect to? I have a working php TCP/IP server socket bound to a port >1023 and the flash client will not...
0
by: sa6113 | last post by:
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? ...
4
by: keithseah | last post by:
Hi all, i've been having this problem and its kiiling me! i'm a newbie at this so i hope someone would be able to help me. picture link:...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.