472,358 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 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 10068

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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
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 required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.