473,388 Members | 1,468 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,388 software developers and data experts.

WinSock Error (Error code: 10054)

SK
Hi all,

I am dealing with sockets in my code.

I open them like -
System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse
(szIPSelected);
System.Net.IPEndPoint remoteEndPoint = new System.Net.IPEndPoint
(remoteIPAddress, alPort);
// Connect to the remote End point in the socket.
m_socClient.Connect(remoteEndPoint);

After having done my work I close it by-
m_socClient.Shutdown(SocketShutdown.Both);
m_socClient.Close();

I get an error "An existing connection was forcibly closed by the remote host
Error code: 10054" after running the application several times.
Am I missing on something?

Best regards,
SK
Nov 15 '05 #1
3 10179

This is normal error, what you must skip or handle.

This happens when computer you are connected to closes connection(without
ShutDown).
"SK" <sk@hotmail.com> wrote in message
news:<Ou**************@tk2msftngp13.phx.gbl>...
Hi all,

I am dealing with sockets in my code.

I open them like -
System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse
(szIPSelected);
System.Net.IPEndPoint remoteEndPoint = new System.Net.IPEndPoint
(remoteIPAddress, alPort);
// Connect to the remote End point in the socket.
m_socClient.Connect(remoteEndPoint);

After having done my work I close it by-
m_socClient.Shutdown(SocketShutdown.Both);
m_socClient.Close();

I get an error "An existing connection was forcibly closed by the remote host Error code: 10054" after running the application several times.
Am I missing on something?

Best regards,
SK

Nov 15 '05 #2
SK
So does that mean that I am bound to get such errors when opening/closing
sockets many times.
So is simply ignoring these error messages fine?
I was thinking that I made some mistake in closing the sockets.

Best regards,
SK

"Ivar" <iv**@lumisoft.ee> wrote in message
news:#f**************@tk2msftngp13.phx.gbl...

This is normal error, what you must skip or handle.

This happens when computer you are connected to closes connection(without
ShutDown).
"SK" <sk@hotmail.com> wrote in message
news:<Ou**************@tk2msftngp13.phx.gbl>...
Hi all,

I am dealing with sockets in my code.

I open them like -
System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse
(szIPSelected);
System.Net.IPEndPoint remoteEndPoint = new System.Net.IPEndPoint
(remoteIPAddress, alPort);
// Connect to the remote End point in the socket.
m_socClient.Connect(remoteEndPoint);

After having done my work I close it by-
m_socClient.Shutdown(SocketShutdown.Both);
m_socClient.Close();

I get an error "An existing connection was forcibly closed by the remote

host
Error code: 10054" after running the application several times.
Am I missing on something?

Best regards,
SK


Nov 15 '05 #3
So is simply ignoring these error messages fine? Usually yes, but it depends if you want notify your app that remote computer
closed connection.
I was thinking that I made some mistake in closing the sockets. I'm sure that your destination machine(server) causes this. If you send
Shutdown() then server won't
close connection as expected, it just closes it (No shutdown).

"SK" <sk@hotmail.com> wrote in message
news:<um**************@TK2MSFTNGP12.phx.gbl>... So does that mean that I am bound to get such errors when opening/closing
sockets many times.
So is simply ignoring these error messages fine?
I was thinking that I made some mistake in closing the sockets.

Best regards,
SK

"Ivar" <iv**@lumisoft.ee> wrote in message
news:#f**************@tk2msftngp13.phx.gbl...

This is normal error, what you must skip or handle.

This happens when computer you are connected to closes connection(without ShutDown).
"SK" <sk@hotmail.com> wrote in message
news:<Ou**************@tk2msftngp13.phx.gbl>...
Hi all,

I am dealing with sockets in my code.

I open them like -
System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse
(szIPSelected);
System.Net.IPEndPoint remoteEndPoint = new System.Net.IPEndPoint
(remoteIPAddress, alPort);
// Connect to the remote End point in the socket.
m_socClient.Connect(remoteEndPoint);

After having done my work I close it by-
m_socClient.Shutdown(SocketShutdown.Both);
m_socClient.Close();

I get an error "An existing connection was forcibly closed by the
remote host
Error code: 10054" after running the application several times.
Am I missing on something?

Best regards,
SK



Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ophir | last post by:
Hello all ! I wrote a simple ActiveX DLL to wrap winsock functionality so I can use it in an ASP page. I call it MyWinSock In the Class module I use this declaration: Dim ctlSocket as...
1
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no...
7
by: Nadav | last post by:
Hi I am writing some kind of a storage system that have to deal with large amounts of data passing over the net, Now, I Wonder... traditional programming would use win32 Winsock DLL as the means...
1
by: Glen Conway | last post by:
Hi, I'm trying to use the gethostbyname function from wsock32.dll and failing dismally Has anyone got a successful implementation of this in VB.NET? My ulitimate goal is to resolve NetBIOS names...
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
0
by: imonline | last post by:
Hi, I have created a asp.net page which posts XML on the web service using .net 2.0. The page and the webservice was working fine but once I converted them to .net 3.5 I have been getting...
3
osfreak
by: osfreak | last post by:
i have a client,server application... I have made the server to listen and accept a connection. The client also connects successfully The connection works good except that i get the WSAECONNRESET...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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,...

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.