annotate xsocket.h @ 262:ebbe0f198322

Fix DDS client connection retry
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Tue, 16 Jun 2015 17:16:11 +0200
parents a03df7dc98f8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
261
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
1 #ifndef __XSOCKET_H__
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
2 #define __XSOCKET_H__
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
3
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
4 #ifdef _CVI_
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
5 #include <ansi_c.h>
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
6 #else
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
7 #include <stdlib.h>
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
8 #endif
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
9
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
10 struct xsocket {
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
11 char *hostname;
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
12 int port;
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
13 int fd;
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
14 };
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
15
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
16 struct xsocket * xsocket(const char *hostname, const int port);
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
17 int xconnect(struct xsocket *s);
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
18 int xsend(struct xsocket *s, const char *data, size_t len);
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
19 int xrecv(struct xsocket *s, char *buffer, size_t len);
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
20
262
ebbe0f198322 Fix DDS client connection retry
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 261
diff changeset
21 int xcommand(struct xsocket *s, const char *frmt, ...);
ebbe0f198322 Fix DDS client connection retry
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 261
diff changeset
22 int xask(struct xsocket *s, const char *data, size_t datalen, char *buffer, size_t len);
261
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
23
a03df7dc98f8 Add xsocket wrappers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
24 #endif