10-18-2014
OK. So you're sending a request to a server on a socket and immediately after sending the request, you try to read a response from the server with NDELAY set in the socket options. There is no server and no network that can respond that fast to a request.
There are a couple of obvious things you could try:
- Drop the TCP_NDELAY socket option so the read() will wait for data instead of returning immediately if no data is present.
- Drop the 1st read() and start with the poll() or pollsys() to wait for data to be present before attempting the read().
I haven't tried to evaluate the arguments to
pollsys() to see if your program is waiting for data on a group of file descriptors or just waiting for data on fd #4. If it is just waiting for data on fd #4, I would start by trying #1; but if your program can continue processing if data is available on another file descriptor as well, choose option 2.
With what you have shown us there is no way for us to guess why it is taking more than 24 seconds for the server to respond to your request.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I'm a DBA so no abuse please! I've for 5 Oracle Forms processes that are spinning and am trying to find out if they're doing anything:
Running HPUX 11.11
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
9 ? 2735 oracle 241 20 24228K 16668K run 2607:29 84.92... (2 Replies)
Discussion started by: fraze
2 Replies
2. UNIX for Advanced & Expert Users
Hi,
We keep getting hanging Oracle process for our ETL. The dba's asked me to do o truss. All I see is pages and pages of the following,:cool:
pollsys(0xFFFFFFFF7FFF38C8, 1, 0xFFFFFFFF7FFF3800, 0x00000000) = 0
pollsys(0xFFFFFFFF7FFF38C8, 1, 0xFFFFFFFF7FFF3800, 0x00000000) = 0... (0 Replies)
Discussion started by: happyadm
0 Replies
3. Shell Programming and Scripting
Hi all,
while trying to debug and figure out why a lofiadm command was not working on my script, i came across a cmd called "truss"
all i know about it is that it executes the specified command and produces a trace of the system calls it performs, the signals it receives, and the machine faults... (5 Replies)
Discussion started by: wrapster
5 Replies
4. Shell Programming and Scripting
Hi
I have to get redirect the truss ouput to file.
I am doing truss -p 12121 >> output.txt
But it still displays on the screen adn output.txt is empty
Can some help how to do this?
Thanks in advance
Ammu (1 Reply)
Discussion started by: ammu
1 Replies
5. Shell Programming and Scripting
i have to gather some info about a process and redirect it to a1.txt file. For this i m using truss command
truss -po a1.txt $PID_Detail
where $PID_Detail= 1482944 3362976
--------------------------------------------------------------------------
Below the script:
#!/bin/ksh
for i... (6 Replies)
Discussion started by: ali560045
6 Replies
6. AIX
On my VIo I see the following for my disks:
$ lspath | grep hdisk6
Enabled hdisk6 fscsi0 200600a0b82193f7,4000000000000
Enabled hdisk6 fscsi0 200700a0b82193f7,4000000000000
Enabled hdisk6 fscsi2 200600a0b82193f8,4000000000000
Failed hdisk6 fscsi2 200700a0b82193f8,4000000000000
$ lspath |... (8 Replies)
Discussion started by: petervg
8 Replies
7. AIX
Hello,
I'm using AIX 5.3.12.5 and trying to understand truss output.
I'm running a job with real time of 16 minutes but only 4 minutes of CPU time. I'm trying to understand what the process is doing.
I'm getting a lot of
kread,
kpread,
kwrite,
kpwrite...
localhost:~ x$ grep... (1 Reply)
Discussion started by: Kovacs
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I want to trace a background java program which runs in infinite loop. I have used truss command for this.
But the program terminated after some hours with below truss output:
Received signal #1, SIGHUP, in lwp_cond_wait()
/1: siginfo: SIG#0
Please let me know what... (0 Replies)
Discussion started by: Hara Prasad
0 Replies
9. UNIX for Advanced & Expert Users
Hi,
I want to trace a background java program which runs in infinite loop. I have used truss command for this.
But the program terminated after some hours with below truss output:
Received signal #1, SIGHUP, in lwp_cond_wait()
/1: siginfo: SIG#0
Please let me know what... (5 Replies)
Discussion started by: Hara Prasad
5 Replies
10. UNIX for Advanced & Expert Users
Hi,
I am trying to set ulimit for soft stack unlimited, but this is not taking effect, after tracing the ulimit -a unlimited command, the below output was generated, which i am unable to comprehend. Could any one help me with this?
prcbap1-r10prod: truss -d ulimit -s unlimited
Tue Dec 30... (2 Replies)
Discussion started by: NasirAbbasi
2 Replies
LEARN ABOUT SUNOS
sockatmark
sockatmark(3XNET) X/Open Networking Services Library Functions sockatmark(3XNET)
NAME
sockatmark - determine whether a socket is at the out-of-band mark
SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ]
#include <sys/socket.h>
int sockatmark(int s);
DESCRIPTION
The sockatmark() function determines whether the socket specified by the descriptor s is at the out-of-band data mark. If the protocol for
the socket supports out-of-band data by marking the stream with an out-of-band data mark, the sockatmark() function returns 1 when all data
preceding the mark has been read and the out-of-band data mark is the first element in the receive queue. The sockatmark() function does
not remove the mark from the stream.
RETURN VALUES
Upon successful completion, the sockatmark() function returns a value indicating whether the socket is at an out-of-band data mark. If the
protocol has marked the data stream and all data preceding the mark has been read, the return value is 1. If there is no mark, or if data
precedes the mark in the receive queue, the sockatmark() function returns 0. Otherwise, it returns -1 and sets errno to indicate the error.
ERRORS
The sockatmark() function will fail if:
EBADF The s argument is not a valid file descriptor.
ENOTTY The s argument does not specify a descriptor for a socket.
USAGE
The use of this function between receive operations allows an application to determine which received data precedes the out-of-band data
and which follows the out-of-band data.
There is an inherent race condition in the use of this function. On an empty receive queue, the current read of the location might well be
at the "mark", but the system has no way of knowing that the next data segment that will arrive from the network will carry the mark, and
sockatmark() will return false, and the next read operation will silently consume the mark.
Hence, this function can only be used reliably when the application already knows that the out-of-band data has been seen by the system or
that it is known that there is data waiting to be read at the socket, either by SIGURG or select(3C).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
recv(3XNET), recvmsg(3XNET), select(3C), attributes(5), standards(5)
SunOS 5.10 1 Oct 2003 sockatmark(3XNET)