BIND error after crash: how to reset winsock ?

Hello, I have a common problem, after my program crash without
cleaningup winsock correctly I can't bind anymore on the same port,
the only way I found is to restat my windows session.
I tried using SO_REUSEADDR but it just make the bind error hidding not
allowing the communication anymore.

Then as it don't seems to be a material problem (I tried
uninstalling / reinstalling my network card and still can't bind) I
would like to know how to reset the windows component handling the
bind fonction, in other words I would like to reset winsock.

Thanks
0
Greg2fs
4/12/2010 6:48:17 AM
comp.os.programmer.win32 14424 articles. 0 followers. Post Follow

9 Replies
572 Views

Similar Articles

[PageSpeed] 32
Greg2fs wrote:
> Hello, I have a common problem, after my program crash without
> cleaningup winsock correctly I can't bind anymore on the same port,
> the only way I found is to restat my windows session.
> I tried using SO_REUSEADDR but it just make the bind error hidding not
> allowing the communication anymore.
> 
> Then as it don't seems to be a material problem (I tried
> uninstalling / reinstalling my network card and still can't bind) I
> would like to know how to reset the windows component handling the
> bind fonction, in other words I would like to reset winsock.

That's the wrong solution. The right solution is to find out why your 
program is crashing, and fix it so that it doesn't crash any more.

-- 
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within
0
Richard
4/12/2010 6:50:23 AM
On Apr 11, 11:48=A0pm, Greg2fs <greg...@gmail.com> wrote:

> Hello, I have a common problem, after my program crash without
> cleaningup winsock correctly I can't bind anymore on the same port,

What happens when you try?

> the only way I found is to restat my windows session.
> I tried using SO_REUSEADDR but it just make the bind error hidding not
> allowing the communication anymore.

What bind error?

> Then as it don't seems to be a material problem (I tried
> uninstalling / reinstalling my network card and still can't bind) I
> would like to know how to reset the windows component handling the
> bind fonction, in other words I would like to reset winsock.

You forgot to describe your problem. Does some Winsock function return
an error? If so, what function and what error? Or do the functions
succeed and then something doesn't happen? If so, what?

DS
0
David
4/12/2010 8:01:46 AM
On Apr 12, 7:50=A0am, Richard Heathfield <r...@see.sig.invalid> wrote:

> That's the wrong solution. The right solution is to find out why your
> program is crashing, and fix it so that it doesn't crash any more.

Of course he should be investigating the crashes but he'll be able to
do that a lot quicker if he doesn't have to restart his machine after
each crash. :)
0
Leo
4/12/2010 8:18:59 AM
Greg2fs wrote:
> Hello, I have a common problem, after my program crash without
> cleaningup winsock correctly I can't bind anymore on the same port,
> the only way I found is to restat my windows session.
> I tried using SO_REUSEADDR but it just make the bind error hidding not
> allowing the communication anymore.

The reason for that is probably that the socket is still considered in use,
which is also why you can patch it partially by using SO_REUSEADDR. There
are two reasons that could be the case:
1. The program is actually still running. A crash can mean pretty much
anything, it doesn't have to be the executable being terminated, which
would normally clean up the resources.
2. The timeout for the socket hasn't elapsed yet. I think that without
properly shutting down, it can take a minute until the port can be bound
again.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

0
Ulrich
4/12/2010 10:36:50 AM
My problem is than the bind function return -1
If I use SO_REUSEADDR the bind function doesn't return an error but
communcation between my server and client are like if the had returned
-1

For sur I have to avoid my program crashing and I do, but I often have
to stop debugging without letting my program close normaly and it
make me loosing a part of my time. And I think about if the problem
occurs for my users, they will say "f*c#ing app ! Uninstalling... !"

They from what you say it seems that there's no way to reset winsock...
0
Greg2fs
4/12/2010 2:52:41 PM
Greg2fs wrote:
> For sur I have to avoid my program crashing and I do, but I often have
> to stop debugging without letting my program close normaly and it
> make me loosing a part of my time. And I think about if the problem
> occurs for my users, they will say "f*c#ing app ! Uninstalling... !"

Greg, I'm working on a program here that includes a webserver, and I also
often kill the program from the debugger or when it crashes, but I never
had the problem you describe. I'm almost sure that it is something
different that's going wrong, I can't imagine an OS that is not capable of
cleaning up after an application has terminated.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

0
Ulrich
4/12/2010 3:12:58 PM
On Apr 12, 7:52=A0am, Greg2fs <greg...@gmail.com> wrote:

> My problem is than the bind function return -1
> If I use SO_REUSEADDR the bind function doesn't return an error but
> communcation between my server and client are like if the had returned
> -1

I'm not sure how that could be. If 'bind' fails, then 'listen' will
also fail. Are you saying when you use SO_REUSEADDR, 'listen' also
fails? What error does it report? You seem to be leaving out all the
details.

> For sur I have to avoid my program crashing and I do, but I often have
> to stop debugging without letting my program close normaly and it
> make me loosing a part of my time. And I think about if the problem
> occurs for my users, they will say "f*c#ing app ! Uninstalling... !"

For sure your users will be angry if your application crashes a lot.

DS
0
David
4/12/2010 4:17:18 PM
Greg2fs wrote:
> My problem is than the bind function return -1

Please read the docs at http://msdn.microsoft.com. It tells you exactly how
to detect errors and how to find further info.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

0
Ulrich
4/13/2010 6:41:14 AM
I don't use "listen" I work with udp conections...
For some days I finaly use SO_REUSEADDR and I didn't have problem
these days,
don't know what did make my program coundn't communicate.
But thanks for your help.
0
Greg2fs
4/14/2010 6:46:31 PM
Reply:
Similar Artilces:

vxfs errors
[ID 969619 kern.warning] WARNING: msgcnt 7486 vxfs: mesg 008: vx_direrr: vx_dirrem_5 - /usr/l ocal/icp file system dir inode 45937 block 884685 dirent inode 320093 error 2 Sep 4 05:05:59 pete vxfs: [ID 885974 kern.info] vxfs msgcnt 7488 offset 0x000002f0 6c69742e 696e2e45 54432e30 33313233 Please advise. thanks, scott ...

ISC bind -vs- Microsoft implementation of bind.
Hi, I have been responsible for our dns at where I work for years. We started out using a Vax running Multinet and have migrated to Linux using ISC's bind. I have been asked to justify using bind and why we don't move over to Microsoft. I have looked on the net and the only discussions I see look more like religious wars, I was hoping to find something a little more technical. I have used Microsoft in the past and have had problems. Of course, working at a large company, they would rather hear it from someone else. Can someone point me to some technical comparisons betwe...

Error referring to a template within a template
Hi everyone, I've come up against an issue with template types. Interestingly enough it seems to trigger a bug in GCC 3.3.4 (it accepts the code but wrongly replaces the typename), whereas Comeau's online compiler reports it as an error. Either way I don't quite understand what the problem is. If someone could point it out for me, it would be much appreciated! Comeau gives this error: "ComeauTest.c", line 37: error: type name is not allowed return createValueContainer<R>::DBType<DBT>::createAltValue(pField); ...

Re: Replication first steps error
--0__=8ABBE56EDFE2BCB68f9e8a93df938690918c8ABBE56EDFE2BCB6 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable it reviews if "localhost.localdomain" es el LOCALHOST. It seems to me t= hat in the 3th column (name of host) you must place IP address of the serv= er and not localhosts. The BD this listening in the LOCALHOSTS and not in = the other interfaces Saludos, Ricardo Rojas Sotelo Infraestructura & Tecnolog=EDa SubGerencia de Producci=F3n Gerencia Sistema de Informaci=F3n. T-Gestiona rrojas@t-gestiona.com.pe (...

Canon PIXMA iP5200
I have a Canon PIXMA iP5200 that I'm generally pleased with. However, recently it has been giving me an error message when I try to print that I have more than one cyan cartridge installed. I have only one and it is in the correct slot. It is not empty as far as I can tell - the fiber part of the reservoir still appears saturated at about half- height. If I remove and reinsert the cyan cartridge repeatedly and sometimes if I power down the printer and back on, it seems to clear the error and prints normally, but I'm never certain that it's going to come out of it, or how mu...

BIND and LDAP
Hello, I'm running FreeBSD and I intend to install the lastest BIND with LDAP support; my confusion is what is the difference between BIND built with the DLZ LDAP driver and BIND built with the 'sdb' (simplified database interface) as built in the dns/bind97-sdb port? If these are two different ways for BIND to use LDAP, which one should I choose? Thanks for any help. ...

bind a standalone recordset to a form
Hello All, I am looking to whip a recordset out of thin air through a series of database record manipulation (so there is no physical equivalence to any database entities such as a table or compounded query) and then bind that standalone recordset to a form to display the result of such operations. I could seem to find a good way of doing it, as I try to change the recordsource property of the form with no success. So here is what I have got, Private Sub Form_Open(Cancel As Integer) Dim rsRecSet As New ADODB.Recordset rsRecSet.Fields.Append "Account ID", adVarChar, 20 ...

Corrected Memory Error detected by CPU
Should I _start_ to worry when I see the message below ? Aug 3 08:58:47 syddb621 SUNW,UltraSPARC-II: [ID 520455 kern.info] [AFT0] Corrected Memory Error detected by CPU10, errID 0x001ecff3.0bc8ca09 Aug 3 08:58:47 syddb621 AFSR 0x00000000.00100000<CE> AFAR 0x00000000.91526b68 Aug 3 08:58:47 syddb621 AFSR.PSYND 0x0000(Score 05) AFSR.ETS 0x00 Fault_PC 0x10025330 Aug 3 08:58:47 syddb621 UDBL Syndrome 0x25 Memory Module Board 9 J3100 Aug 3 08:58:47 syddb621 SUNW,UltraSPARC-II: [ID 918507 kern.info] [AFT0] errID 0x001ecff3.0bc8ca09 Corrected Memory Error on Board 9 J3100 is ...

MASM link errors
Hello: I just download msm9.0 When I compile and link my asm programs follows, I always get error messages: Assembling: example4.asm Microsoft (R) Incremental Linker Version 5.12.8078 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /z2 "example4.obj" /t "example4.com" NUL LINK : warning LNK4044: unrecognized option "z2"; ignored LINK : warning LNK4044: unrecognized option "t"; ignored example4.obj : warning LNK4033: converting object format from OMF to COFF example4.obj : fatal error LNK1190: invalid fixup found, type 0x0001 What'...

Error reading a file into a data set
Hello, I'm trying to read a datafile into a dataset. The datafile has 6 records and 4 columns, and the values are like this: 000 0000 6 Feriepengegrunnlag 001 0001 7 Adresse-4 111A 0100 6 L�nn, honorarer mv 112A 0100 6 Trekkpliktige naturalytelser 113 0100 6 L�nn mv utf�rt i utlandet 113A 0100 6 L�nn mv utf�rt i utlandet There is a CRLF just after the last letter in the 4.column. I use this code: filename koder "D:\KODER.TXT"; data koder; infile koder lrecl=79 recfm=V; input @1 kode $7. @8 kodegr $4. @12 type $5. @17 kodetek...

error while propagating password
Hi, I am trying to run netdump client in Linux. I have updated /etc/sysconfig/netdump as NETDUMPADDR=netdump-server ip address First I tried "service netdump propagate" to propagate the password but I am getting an error as bash: line 1: /var/crash/.ssh/authorized_keys2: Permission denied I have used arping -c 1 -I eth0 10.150.12.144 to know whether the server and the host using the same DEV. Please let me know what is the issue.Its bit urgent . Thanks. In article <2bc89f21-e2e5-4b48-987c-baa3ff914ec2@a29g2000pra.googlegroups.com>, <balireddy.vindhya@gmail.com> ...

First 8 MB Error on 10.3
Hi, I have an Imac Rev a 233 Mhz that I am trying to upgrade to os 10.3.9 I have followed the instruction on various forums on how to do this. I now have 256MB RAM in top slot and 32 MB in bottom slot and the standard 2 MB Video RAM I downloaded the v1.2 patch from apple to upgrade to os 10.3 I boot from the 10.3 cd ok but cant get past the hard drive testing stage of the install. I have tried 1 or 2 partitions and another hard drive as well as making sure the hard drive is fully erased, before I install. I have also tried upgrading from 9.2.2 .... But the problem is always the same T...

Bind 9.2.4 slaving problem [bind 9.2.1 and bind 8.3.3]
Greetings. I have a master name server running BIND 9.2.1 [Debian Woody - server not available on the Internet] and a slave server running bind 9.2.4 [Debian Sarge - not currently available on the Internet] and two others running bind 8.3.3 [Debian Woody - on the Internet]. The 9.2.1 is a master for all the others to slave from. I have an entry in a zone defined on the master as the following: > $ORIGIN example.com. > spamhaus-datafeed IN NS local-rbl-a > spamhaus-datafeed IN NS local-rbl-b When I issue the following command: #> host -t nx spam...

Bind
MAINCBS -> CALL1S -> CALL2S CALL1S -> CALL3S -> CALL2S CALL1S -> CALL4S CALL1S -> CALL5S -> CALL6S -> CALL3S -> CALL2S MAINCBS is a COBOL program and also a final object to be used. CALL1S thru CALL6S are reusable components. CALL1S calls CALL2S thru CALL5S and so on. if i make changes to CALL4S and CALL2S. For my final compilation unit, i need to compile all the programs in the below order. CALL2S CALL3S CALL6S CALL5S CALL4S CALL1S MAINCBS The above strcuture is simple so i can find the order of comp...

Re: Fwd: error message Nlmixed #2
Hi Dale, Thank you for your answer ! Johanna 2007/4/12, Dale McLerran <stringplayer_2@yahoo.com>: > > Johanna, > > Yes, missing data is not gracefully handled for you by the NLMIXED > procedure, unlike most other SAS procedures. You need to exclude > data with missing values from entering into the NLMIXED procedure. > > Dale > > > --- Johanna Lepeule <jlepeule@GMAIL.COM> wrote: > > > ---------- Forwarded message ---------- > > From: Johanna Lepeule <jlepeule@gmail.com> > > Date: 11 avr. 2007 12:31 > > Subject: R...

A97
I get error 3315 when attempting to enter ZLS into a text-type table field whose allow zls property is set to false. The error says "Field MyTable.MyField can't be a zero-length string" For sure, this is what I expected, entering into a table. The same 3315 error occurs if you try to enter "" into a bound textbox control on a form (bound to the same field. I expected that too. I was wondering if its possible to trap this error and process it with my own error-handler - when I see it form an open form. Is this possible? And, if so, which of the applicable textbox even...

-127 error when launching Outlook 5
I am on system 9.0.3 iMac, launching Outlook Express 5.0.6 I get a -127 error upon launch now. Have used program faithfully for years with no problem. Also gives me the same error when trying to reinstall another version of same program, in order to do a clean install. I looked into the error code online but there offered no solution. Thanks in advance GKD On 2007-06-04 22:14:19 -0500, Coffee in Madrid <gdeppe@THISeastlink.ca> said: > I am on system 9.0.3 iMac, launching Outlook Express 5.0.6 > > I get a -127 error upon launch now. Have used program faithfully for >...

Error 3 "Path not found"
Team, Thanks for your assistance in advance. I am inexperienced with TopSpeed. I am using Clarion 4b and am getting an error 3 when I try to convert the dictionary after making changes. Where am I loosing it? Thanks again Hal byd@bydsoftware.com Can be caused by spaces in your path somewhere. "Hal & Kathy Lockwood" <byd@bydsoftware.com> wrote in message news:40084544_1@athena.netset.com... > Team, Thanks for your assistance in advance. > I am inexperienced with TopSpeed. > I am using Clarion 4b and am getting an error 3 when I try to convert the > dictiona...

DNS requests error sending response: host unreachable
--20cf300fab4317dc0f04bb0d2257 Content-Type: text/plain; charset=ISO-8859-1 Dear community, I do have many error in my Bind's log file such as : client 192.168.201.1#29404: error sending response: host unreachable It seems that I have an iptables issue as each time I shut iptables I don't have anymore this message showing up. I saw that my firewall is dropping packets from the DNS server itself towards the client, as the source port is SPT=53/UDP. I am using bind 9.6, it should use random port >1024 for the source port. (I didn't specify query-source parame...

Error~~ HELP!!
I have the below code in my program bool MainApp::OnInit() { win = new MainFrame("McPosim - A Monte Carlo Positron Simulation Software", wxPoint (100, 100), wxSize(450, 340), wxMAXIMIZE | wxDEFAULT_FRAME_STYLE); win->Show(TRUE); SetTopWindow(win); return TRUE; } void MainApp::OnEditPoint(wxCommandEvent & WXUNUSED(event)) { win->SetStatusText("Hello"); } BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(ID_MAINWIN_QUIT, MainFrame::OnQuit) EVT_BUTTON(ID_DATA_POINTS, MainApp::OnEditPoint) END_EVENT_TABLE() But it kee...

help me for the error
Im devoloping a vb.net Application im using dll file for excel managment,internet explorer the application working in my computer and some other computer, But one computer is not working when it execte after installing application. problems 1) first MDAC problem I solve the exception problem Installing MDAC...exe file 2) After that an error {CLSID 0000000 - 0000 - 0000 - 0000046} not valid/ unregistered Im trying to register the dll s using regsvr32.exe, But not resolve the problem, error when using regsvr32.exe Pls Return the solution to this problem ...

Resolution of -9589 printing error
The good people at Now Up-to-Date have come through with the answer to my problem. The answer is not at all obvious. I pass this along as a guide to anybody else facing this problem. On 7/6/06 3:40 PM, "Mark Schupack" <Mark2149@cox.net> wrote: I just installed Now Up-to-Date and created a month's calendar. When trying to print it out, i got the error message unexpected error -9589. I am using a MAC system 10.4.7 on a desktop G4. Additional information: the same error message was received when trying to print out a page of a Palm calendar using the Palm Desktop software. ...

All the binding attractions in all the invisible forces must be seen as PHASE COHERENCE so type "phase coherence" into Google. #2
All the binding attractions in all the invisible forces must be seen as PHASE COHERENCE so type "phase coherence" into Google. Then you will find - - what Einstein couldn't - - the fact that I stated about "phase coherence". It's at many places in Google. It was at the #1 TOP spot, in Google, from Sept./22/2010 . . . to . . . Oct./04/2010 (Fitz Finds a fact! - - Phase Coherence is the reason...) Why did it take top spot in Google? Because it's REALLY what is happening. To see it click link: http://www.amperefitz.com/top.spot.htm Daniel P. Fitzpatrick Jr. ...

Running BIND CHRooted?
Does anyone know of a caching resolver ported to OpenBSD that runs as an unprivileged user. Apparently BIND has options for this but the Internet is filled with posts by people who say they could not get it to work. -- Will "Will" <westes-usc@noemail.nospam> writes: > Does anyone know of a caching resolver ported to OpenBSD that runs as an > unprivileged user. Apparently BIND has options for this but the Internet > is filled with posts by people who say they could not get it to work. the default named on OpenBSD runs privilege separated and i...

VPN Soft Reset?
What would cause a Soft Reset to a VPN connection? Is this server initiated or something on my client server that sparked this event? Wed Mar 14 01:04:19 2012 us=29163 TLS: soft reset sec=0 bytes=1556541/0 pkts=12506/0 Wed Mar 14 01:04:19 2012 us=75202 VERIFY OK: depth=1, /C=US/ST=CA/ L=San-Francisco/O=reliablehosting.com/CN=ovpn012/ emailAddress=techies@reliablehosting.com Wed Mar 14 01:04:19 2012 us=75380 VERIFY OK: nsCertType=SERVER Wed Mar 14 01:04:19 2012 us=75393 VERIFY OK: depth=0, /C=US/ST=CA/ L=San-Francisco/O=reliablehosting.com/CN=vpn-dc12/ emailAddress=techies...