[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sockets timeouts
I have a simple sockets client that uses the sockutils procedures.
Worked for a long time no problems.
I now have a situation where my client times out because the remote
program takes too long.
I use all the standard parameters without change, this is the jist of
the RPG:
0020.00 D/copy mysoclib/qrpglesrc,socket_h
0021.00 D/copy mysoclib/qrpglesrc,errno_h
0022.00 D/copy mysoclib/qrpglesrc,sockutil_h
282.00 C*************************************************
283.00 C* Create a socket
284.00 C*************************************************
285.00 c eval sock = socket(AF_INET: SOCK_STREAM:
286.00 c IPPROTO_IP)
0301.00 C*************************************************
0302.00 C* Create a socket address structure that
0303.00 C* describes the host & port we wanted to
0304.00 C* connect to
0305.00 C*************************************************
0306.00 c eval addrlen = %size(sockaddr)
0307.00 c alloc addrlen p_connto
0308.00
0309.00 c eval p_sockaddr = p_connto
0310.00 c eval sin_family = AF_INET
0311.00 c eval sin_addr = addr
0312.00 c eval sin_port = port
0313.00 c eval sin_zero = *ALLx'00'
0314.00
0315.00 C*************************************************
0316.00 C* Connect to the requested host
0317.00 C*************************************************
0318.00 C if connect(sock: p_connto: addrlen) <
0
0319.00 c eval err = errno
***** send some data
0359.00 c eval OutRec = 'SIGNFILE'
0362.00 c callp WrLine(sock: OutRec)
0364.00 C* Get back PC response
0365.00 C eval rc = rdline(sock: %addr(recbuf):
0366.00 c %size(recbuf): *On)
Reading through the sockets utilities, I can find 2 references to
timeouts:
tv_sec = 60 with FD_SET
And SO_RCVTIMEO = 50
Can anyone tell me which is the appropriate value that will be used by
the rdline proc, and how I can change it dynamically in my program.
Many thanks
Ian Patterson
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------