08-18-2010
Nothing bad happens when you write to both ends at the same time. What precisely happens when depends on a lot of things like buffers, framing, and transit time, but two-way traffic is still just business as usual. If the data has arrived by the time one of them finishes a write(), yes, a read() may be able to get it.
9 More Discussions You Might Find Interesting
1. Programming
I have client and server connected.
client write and read from csock.
server write and read from ssock
suppose the server does :
....
close(ssock); //send FIN to client
othertask();
....
READ ERROR
if after the server close() the client does:
...
read(csock,...);
...... (2 Replies)
Discussion started by: gio
2 Replies
2. Programming
I am presently refactoring a windows deamon with an eye towards porting it to linux someday.
Presently the application uses a single background thread and asynchronous socket I/O to implement FTP and HTTP clients in a single switch statement (2000 lines and 100 cases just for the switch... (3 Replies)
Discussion started by: siegfried
3 Replies
3. IP Networking
Hi Friends,
I have written a program which will listener for more than 1000 requests per second from a single socket descriptor and then it will process those requestes. Its taking X amount of time. Now i want to reduce that time. Will I can write multiple threads to receive the... (2 Replies)
Discussion started by: pa.chidhambaram
2 Replies
4. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
5. IP Networking
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies
6. Programming
How to know whether socket is ready for write.
select(maxfds, (fd_set *)NULL, &writefds, NULL, &timeout);
By default socket is set for write without checking whether it would block or not? If so how do I know my FD is ready for writing. (3 Replies)
Discussion started by: satish@123
3 Replies
7. Shell Programming and Scripting
Hello all,
I have a requirement to read and write to a tcp socket from an HP-UX shell script. I see a /dev/tcp character device on my servers:
crw-rw-rw- 1 root root 72 0x00004f Mar 28 18:37 /dev/tcp
So I believe this is what I should use. The problem is that all the... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies
8. Shell Programming and Scripting
Hi All,
I need the answer of below question?
1) How to write multiple cronjobs in shellscript? Is there any way or we cant write in shellscript...
Regards,
Priyanka (2 Replies)
Discussion started by: pspriyanka
2 Replies
9. Programming
(Apologies for any typos.)
OSX 10.12.3 AND Windows 10.
This is for the serious Python experts on at least 3.5.x and above...
In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly.
Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT PHP
socket_send
SOCKET_SEND(3) 1 SOCKET_SEND(3)
socket_send - Sends data to a connected socket
SYNOPSIS
int socket_send (resource $socket, string $buf, int $len, int $flags)
DESCRIPTION
The function socket_send(3) sends $len bytes to the socket $socket from $buf.
PARAMETERS
o $socket
- A valid socket resource created with socket_create(3) or socket_accept(3).
o $buf
- A buffer containing the data that will be sent to the remote host.
o $len
- The number of bytes that will be sent to the remote host from $buf.
o $flags
- The value of $flags can be any combination of the following flags, joined with the binary OR ( |) operator.
Possible values for $flags
+--------------+---------------------------------------------------+
| | |
| MSG_OOB | |
| | |
| | Send OOB (out-of-band) data. |
| | |
| | |
| MSG_EOR | |
| | |
| | Indicate a record mark. The sent data completes |
| | the record. |
| | |
| | |
| MSG_EOF | |
| | |
| | Close the sender side of the socket and include |
| | an appropriate notification of this at the end of |
| | the sent data. The sent data completes the trans- |
| | action. |
| | |
| | |
|MSG_DONTROUTE | |
| | |
| | Bypass routing, use direct interface. |
| | |
+--------------+---------------------------------------------------+
RETURN VALUES
socket_send(3) returns the number of bytes sent, or FALSE on error.
SEE ALSO
socket_sendto(3).
PHP Documentation Group SOCKET_SEND(3)