473,387 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 4235
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 other is plugged into a switch. My plan is that...
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 millisecondsTimeout, Boolean exitContext) at...
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 subsequent downloading if there have been changes to...
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 String =...
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 datagram() As Byte = {69, 0, 0, 52, 108, 180, 0, 0,...
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 a socket communication program so that it...
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 even connect to it. I can connect to it with non-xml...
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? 1- I have installed freeSSHD in server machine? Is...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.