Sponsored Content
Full Discussion: Write-Write on a socket
Top Forums Programming Write-Write on a socket Post 302446409 by gendaox on Wednesday 18th of August 2010 02:49:21 PM
Old 08-18-2010
Write-Write on a socket

Can anyone tell what happens if each end writes at the same time on the same socket ?
- if one of them issues a read() after write() has completed, will it record into the buffer what the other sent ?

ex.
e1 writes to e2 - - - while - - - e2 writes to e1 (at the same time)

e1 read () - what will he read ?
 

9 More Discussions You Might Find Interesting

1. Programming

read/write socket error

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

How to Write Linux Friendly Async Socket I/O

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

Can we write a multiple thread to receive from a single socket file descriptor

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

Find all files with group read OR group write OR user write permission

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

read/write,write/write lock with smbclient fails

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

write on Non Blocking Socket

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

Read and write to tcp socket

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

Is it possible to write write multiple cronjobs in shellscript??

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

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(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
stroptions(9S)						    Data Structures for Drivers 					    stroptions(9S)

NAME
stroptions - options structure for M_SETOPTS message SYNOPSIS
#include <sys/stream.h> #include <sys/stropts.h> #include <sys/ddi.h> #include <sys/sunddi.h> INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI) DESCRIPTION
The M_SETOPTS message contains a stroptions structure and is used to control options in the stream head. STRUCTURE MEMBERS
uint_t so_flags; /* options to set */ short so_readopt; /* read option */ ushort_t so_wroff; /* write offset */ ssize_t so_minpsz; /* minimum read packet size */ ssize_t so_maxpsz; /* maximum read packet size */ size_t so_hiwat; /* read queue high water mark */ size_t so_lowat; /* read queue low water mark */ unsigned char so_band; /* band for water marks */ ushort_t so_erropt; /* error option */ The following are the flags that can be set in the so_flags bit mask in the stroptions structure. Note that multiple flags can be set. SO_READOPT Set read option. SO_WROFF Set write offset. SO_MINPSZ Set minimum packet size SO_MAXPSZ Set maximum packet size. SO_HIWAT Set high water mark. SO_LOWAT Set low water mark. SO_MREADON Set read notification ON. SO_MREADOFF Set read notification OFF. SO_NDELON Old TTY semantics for NDELAY reads and writes. SO_NDELOFFSTREAMS Semantics for NDELAY reads and writes. SO_ISTTY The stream is acting as a terminal. SO_ISNTTY The stream is not acting as a terminal. SO_TOSTOP Stop on background writes to this stream. SO_TONSTOP Do not stop on background writes to this stream. SO_BAND Water marks affect band. SO_ERROPT Set error option. When SO_READOPT is set, the so_readopt field of the stroptions structure can take one of the following values. See read(2). RNORM Read message normal. RMSGD Read message discard. RMSGN Read message, no discard. When SO_BAND is set, so_band determines to which band so_hiwat and so_lowat apply. When SO_ERROPT is set, the so_erropt field of the stroptions structure can take a value that is either none or one of: RERRNORM Persistent read errors; default. RERRNONPERSIST Non-persistent read errors. OR'ed with either none or one of: WERRNORM Persistent write errors; default. WERRNONPERSIST Non-persistent write errors. SEE ALSO
read(2), streamio(7I) STREAMS Programming Guide SunOS 5.11 14 Nov 1996 stroptions(9S)
All times are GMT -4. The time now is 11:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy