Re: socket programming error
Sounds like the remote host is having a memory exception as a result of the message that it is receiving somehow. After you send this message what happens to the client on the remote host?
Re: socket programming error
this error is in the client side and stop it , server just runing and wait for client .
do u know why this problem has occurred ?
can this related to port number i used or cause of windos accessibility ... I don't know ! but I need too fix it !!
I can give the codes , if it is necessary.
Re: socket programming error
Most likely the client sends a message to the server, the server sends back a response, but the client can't handle the response data and dies.
This could be because the server response is not correct, or because the client code to handle the response is not correct.
from the MSDN:
Quote:
WSAECONNRESET 10054
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.
Re: socket programming error
Is the server/router set to allow UDP on the given port?
Re: socket programming error
AAaah this is a good point, is the router configured to allow comms on the port?
Re: socket programming error
just asking about allow the program to run , nothing about the port !
but i check the port i used , it's open !
Re: socket programming error
The port is important. Is the server you are connecting to written by you as well? Is it on the same LAN? Your message indicates that your attempt to send UDP was effectively booted by the receiver.
Re: socket programming error
Better check your firewall. Complaining about it won't help!
;)
Re: socket programming error
about the program and port , I use port number 9050 and it is open in my pc.
and i should say that I try another program ( with this purpose) , and it has a same problem! so i think this isn't related to codes.
about the LAN , yes they are on the same and I set right IP . ;)
and firewall , i turned it off ! (in "windows firewall with advanced security" / "windows firewall propertiese"/ turned off domain,private,public profiles)
Re: socket programming error
So both programs are running on the same pc ?
Re: socket programming error
yeah , try them on same pc.
about the ports , i have a question : is there a special port num for sending text message in udp ? or not , i can use any port , just open port ?!
Re: socket programming error
It's been a very long time since I have did anything at all with UDP. I use TCP for all communications now. I can't remember if there was any issues with running 2 UDP programs on the same PC or not.
There is no special port, just needs to be one that is available.
You still have not told us if the program you are sending to is a program written by you or someone else. If you have the code then it would be good to see what happens there when you send a message, for example does a received event fire? If the program was not written by you are you sure it accepts UDP transmissions? Have you tried it on a different PC from your client?
Re: socket programming error
Hmmm well #
1 just because both apps are on the same PC doesn't mean the firewall aint in the way. What address are you sending the packets too? Your IP or "127.0.0.1" or are you using a DNS function?
#2 Better post some source code, otherwise you get to hear all our fancy guesswork.
When you do post your code, put it in code tags.
It is an icon that looks like # between the <> icon and the quote icon.
Code:
void main (void)
{
//...
}
HTH,
Re: socket programming error
to DataMiser : no i don't write the program and about UDP transmission how can i know this ?!
yeah i should try it on other PC...
to ahoodin :
tnx for fancy guesswork ! i totally listen to them ;)
about the address , use 127.0.0.1
and i don't understand u , what's code tag ?!