summaryrefslogtreecommitdiffstats
path: root/src/H5FDstream.h
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2001-07-02 12:57:46 (GMT)
committerThomas Radke <tradke@aei.mpg.de>2001-07-02 12:57:46 (GMT)
commit9f06972b488063ee9e36a3063751b7d9025946d0 (patch)
tree60de486f9e3cb7765ecc70b92e7387ac50093884 /src/H5FDstream.h
parent8c2c4cd51cb8dd1393acad65e3f015d76bfd9563 (diff)
downloadhdf5-9f06972b488063ee9e36a3063751b7d9025946d0.zip
hdf5-9f06972b488063ee9e36a3063751b7d9025946d0.tar.gz
hdf5-9f06972b488063ee9e36a3063751b7d9025946d0.tar.bz2
[svn-r4090]
Purpose: Implemented port hunting Really catch SIGPIPE signals Description: Port hunting allows to try and bind to a successive port number if the port number given in the filename is already used. Because of a stupid typo in the code, SIGPIPE wasn't catched which might have caused the sending side to hang. Solution: The Stream VFD's file access property list was extended by two elements: - maxhunt: how many successive ports to try if the one given in the filename is already in use Default is not to hunt for additional ports. - port: port number which is finally used to bind a socket This might be different to the port number as given in the filename if port hunting is enabled. The H5Pget_fapl_stream() can be used to obtain this port number. Platforms tested: x86 Linux, Irix 32/64 bit, Dec Alpha, Unicos on T3E, AIX on SP2 Hitachi SR8000
Diffstat (limited to 'src/H5FDstream.h')
-rw-r--r--src/H5FDstream.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5FDstream.h b/src/H5FDstream.h
index 9276cc4..f6c70ca 100644
--- a/src/H5FDstream.h
+++ b/src/H5FDstream.h
@@ -40,7 +40,7 @@
#include <winsock.h>
#define H5FD_STREAM_SOCKET_TYPE SOCKET
-#define H5FD_STREAM_INVALID_SOCKET SOCKET_ERROR
+#define H5FD_STREAM_INVALID_SOCKET INVALID_SOCKET
#endif
@@ -59,11 +59,13 @@ typedef int (*H5FD_stream_broadcast_t) (unsigned char **file,
typedef struct H5FD_stream_fapl_t
{
size_t increment; /* how much to grow memory in reallocs */
- H5FD_STREAM_SOCKET_TYPE socket; /* external socket descriptor */
+ H5FD_STREAM_SOCKET_TYPE socket; /* externally provided socket descriptor*/
hbool_t do_socket_io; /* do I/O on socket */
int backlog; /* backlog argument for listen call */
H5FD_stream_broadcast_t broadcast_fn; /* READ broadcast callback */
void *broadcast_arg; /* READ broadcast callback user argument*/
+ unsigned int maxhunt; /* how many more ports to try to bind to*/
+ unsigned short int port; /* port a socket was bound/connected to */
} H5FD_stream_fapl_t;