socket problem..

socket problem..

Post by d2003x » Wed, 22 Jan 2003 02:15:10



Hello!

It is:

I have the code that uses "select()" to accept requests from a socket.
But recently (it had never happened before I recompiled the kernel):

/////////////////////////////////////////////////////////////////////

bind()
listen()

sleep(1) // or do anything that can waste time for a while. But if I
         // remove the part, the following "accept()" reports "Invalid
         // argument" (EINVAL) when there is a new request coming.

while(1)
  {
    select()
    accept()
  }

//////////////////////////////////////////////////////////////////////

Can somebody tell me what causes the odd problem?? thanks.

--
d2003xx
Non-free software is wrong and we do not want it in our lives -- RMS
xx2002d -- selohssa era sresu sti dna xus swodniW

 
 
 

1. Interesting Sockets Problem (between generic sockets client and Sybase?)

Hi,

I have a UNIX sockets client application making a connection to a sockets
server that I have also written. For the most part things have been
working great.

However, when this sockets client shared library that I have written is
brought into an application that also makes a connection to Sybase
problems occur. The problem is that the first time we make a connection
to our sockets server everything works OK; however, the next time we make
a connection to our sockets server application the host address
information is that of the host where the Sybase server is. If there is a
delay (say a sleep of 1 second) everthing works as expected.

The logic goes something like:

        1. Establish connection to Sybase.

        2. Query Sybase (the connection is left open).

        3. Establish connection to my sockets server. Build and retain
           local "struct  hostent" to remember information for remote
           host.
        4. Exchange data w/ sockets server.

        5. Close connection to my sockets server.

        6. Query Sybase (the connection is left open).

        7. Establish connection to my sockets server using retained
           local "struct hostent".

Note: That if a sleep of 1 second is performed between steps 6 and 7
everything works OK. If a sleep is not performed then the connection in
step 7 is attempted against the host that the Sybase server is on. NOT
WHAT WAS ATTENDED.

I am developing on HP-UX on an HP9000.

Anyone have any ideas on what is going on here??? HELP!!

Thanks!

Jim Lundell,
3M

Opinions expressed herein are my own and may not represent those of 3M.

2. How to run a program on every file?

3. socket help and other sockets problems !?!?

4. TN3270 access across firewall

5. ISDN Router problem/socket problem

6. Setgid on directories

7. Java 1.3 socket problem in 420R with Solaris 5.7

8. MS Intellimouse - wheel functionality

9. FTP and Data socket problem

10. socket problem in Solaris

11. Socket problems

12. AF_INET socket problem

13. Socket problem