Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

socket connect() timeout after server restarts



Hi, All:

I am porting an app from Solaris to Mac OS X.

A target box running vxWorks is connected to a Mac G5 using dedicated ethernet. The Mac G5 acts as tcp server, while the target box is the client.

The porting works in general, but I have a pair of  annoying problems.

When I kill the tcp server in G5, restart it and restart client in the remote box, the client takes a timeout of connect() before the connection to the server is established.

But after a reboot of Mac, eg. the tcp server in Mac G5 has never been killed, the target connect() rather quickly.

The second problem is if I kill the tcp server in the Mac, on the client side, I see the tcp connection is in CLOSE_WAIT state but it never really been closed, and the read() on the client side blocks forever and never returns 0 or -1.

I don't have both problems when running the tcp server on Solaris.

Nagle algorithm is disabled, NO_DELAY is enabled and SO_REUSEADDR is enabled for the sockets.

The code is plain C using socket functions.

Any suggestion?

Regards

Mark


This mail server is the property of Spectral Dynamics, Inc.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.