Sponsored Content
Top Forums Programming TCP trashing data on application close Post 302455813 by Corona688 on Wednesday 22nd of September 2010 12:45:15 PM
Old 09-22-2010
You are enabling non-blocking IO on the socket with ioctl(), meaning, the program won't necessarily wait for it to finish(i.e. block). If you want it to wait for it, don't do that.
 

10 More Discussions You Might Find Interesting

1. IP Networking

secondary TCP application

:cool: I want to use 2 tcp applications in SCO 5.05 senerio I am using VisionFS 3.1 and I need to set it up as a secondary tcp app. I follow the profeditoir and change the tcp port from the primary port (139) to any other number below port 1024 and then restart the VisionFS server it is still... (2 Replies)
Discussion started by: lanman
2 Replies

2. UNIX for Dummies Questions & Answers

Which application has a TCP socket open

If I do a netstat -a I can see all the sockets currently open, is there a way that I can tell which application is holding open these sockets ? (3 Replies)
Discussion started by: murphyboy
3 Replies

3. UNIX for Dummies Questions & Answers

close tcp port

Hello, I have a service running (ODBC) and every now and then it will hang and I will have to stop and restart the service. The problem is when I stop the service, it indeed stops the service, but netstat reports a tcp port still open with the fin_wait_2 status. Then I must close the client... (1 Reply)
Discussion started by: raidzero
1 Replies

4. Programming

problem receiving data from TCP socket

Hi all, I'm writing a socket program which sends a structure from one machine to another. When I run my client first time it runs well, however after the first time I couldn't receive all the data inside the structure (it is like, half of the array is received and the other half is not set). I... (1 Reply)
Discussion started by: SaTYR
1 Replies

5. Programming

close existing tcp connection in C

Hello. I would like to know how to close an existing tcp socket. I have read some stuff and learned how to create a socket and then close it but have not found anything about how to close an existing tcp socket created by another application. The situation is this: I have an ODBC server running and... (6 Replies)
Discussion started by: raidzero
6 Replies

6. Solaris

many tcp connection in close-wait

Hi, I use solaris Unix . I find there is some problem in application and it generate many "close-wait" tcp connect and stay in the server . it is generate by process id 7740 root@XX # netstat -an | grep CLOSE_WAIT | wc -l 285 root@XX # netstat -an | grep CLOSE_WAIT 10.158.35.4.34805 ... (2 Replies)
Discussion started by: abcdef
2 Replies

7. Programming

when parent process close, how to close the child?

can someone provide an example, where if the parent process quits for any reason, then the child process will also close? (3 Replies)
Discussion started by: omega666
3 Replies

8. IP Networking

Packetize data to send it over tcp sockets

Hello All, I am very new to socket programming and client server architecture. I have to write a client which will send some data to server and server will display it on its console. I am ready with both client and server but my problem is with packetizing of data -- I have... (1 Reply)
Discussion started by: anand.shah
1 Replies

9. Shell Programming and Scripting

Want to backup dirs on application start and close.

Hi I want to write a script that will back up one directory if a certain application launches and then backs up another directory if that same application is closed down. NFI where to start. It seems like cron isn't the tool for this because that is time based. I'm thinking I need... (6 Replies)
Discussion started by: zorrokan
6 Replies

10. UNIX for Advanced & Expert Users

30 tcp connections Established for a while and after a few minutes are close

Good morning, I need your help please After Restarting Aps or connection, these are connections tcp 0 0 10.80.1.26.57597 10.81.248.79.53008 ESTABLISHED tcp 0 47 10.80.1.26.57607 10.81.248.79.53008 ESTABLISHED tcp 0 0 ... (4 Replies)
Discussion started by: alexcol
4 Replies
socket(7)						 Miscellaneous Information Manual						 socket(7)

NAME
socket - interprocess communications DESCRIPTION
Sockets are communication endpoints that allow processes to communicate either locally or remotely. They are accessed by means of a set of system calls (see socket(2)). The following requests are defined in (see ioctl(2)): If the int with the address arg is non-zero, the socket is put into non-blocking mode. Otherwise, the socket is put into blocking mode. Blocking mode is the default. The request is equivalent to the request, although using is not recommended. See accept(2), connect(2), recv(2), and send(2) for an explanation of how non-blocking mode is used. For SOCK_STREAM sockets, the number of bytes currently readable from this socket is returned in the integer with the address arg. For SOCK_DGRAM sockets, the number of bytes currently readable, plus the size of the sockaddr structure (defined in is returned in the integer with the address arg. For SOCK_STREAM TCP sockets, on return the integer with the address arg is non-zero if the inbound TCP stream has been read up to where the out-of-band data byte starts. Otherwise, the inbound TCP stream has not yet been read up to where the out-of- band data byte starts. For sockets other than SOCK_STREAM TCP sockets, on return the integer with the address arg is always zero. This request sets the process group or process ID associated with the socket to be the value of the integer with the address arg. A process group or process ID associated with the socket in this manner is signaled when the state of the socket changes: is delivered upon the receipt of out-of- band data; is delivered if the socket is asynchronous, as described in below. If the value of the integer with the address arg is positive, the signal is sent to the process whose process ID matches the value specified. If the value is negative, the signal is sent to all the processes that have a process group equal to the absolute value of the value specified. If the value is zero, no signal is sent to any process. It is necessary to issue this request with a non-zero integer value to enable the signal delivery mechanism described above. The default for the process group or process ID value is zero. This request returns the process group or process ID associated with the socket in the integer with the address arg. See the explanation for above for more details on the meaning of the integer value returned. If the integer whose address is arg is non-zero, this request sets the state of the socket as asynchronous. Otherwise, the socket is put into synchronous mode (the default). Asynchronous mode enables the delivery of the signal when either of the following conditions is met. o New data arrives. o For connection-oriented protocols, whenever additional outgoing buffer space becomes available or the connection is established or broken. The process group or process ID associated with the socket must be non-zero in order for signals to be sent. The signal is delivered according to the semantics of described above. The fcntl(2) and flags (defined in are supported by sockets. If the flag is set, the socket is put into POSIX-style non-blocking mode. If the flag is set, the socket is put into non-blocking mode. Otherwise, the socket is put into blocking mode. Blocking mode is the default. See accept(2), connect(2), recv(2), and send(2) for an explanation of how these forms of non-blocking mode are used. Since the and flags and requests are supported, the following clarifies on how these features interact. If the or flag has been set, and requests behave accordingly, regardless of any requests. If neither the flag nor the flag has been set, requests control the the behavior of and DEPENDENCIES
AF_CCITT Only Only the and requests are defined for sockets. AUTHOR
was developed by the University of California, Berkeley. SEE ALSO
fcntl(2), getsockopt(2), ioctl(2), socket(2). socket(7)
All times are GMT -4. The time now is 07:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy