SeaBreeze
NativeSocketPOSIX.h
Go to the documentation of this file.
1 /***************************************************/
30 #ifndef SEABREEZE_NATIVESOCKETPOSIX_H
31 #define SEABREEZE_NATIVESOCKETPOSIX_H
32 
33 #include "native/network/Socket.h"
36 #include <string>
37 
38 namespace seabreeze {
39  class NativeSocketPOSIX : public Socket {
40  public:
42  virtual ~NativeSocketPOSIX();
43 
44  virtual void connect(Inet4Address &addr, int port)
46  virtual void connect(const std::string hostname, int port)
48 
49  virtual void close() throw (BusException);
50  virtual bool isClosed();
51  virtual bool isBound();
52 
53  virtual int getSOLinger() throw (SocketException);
54  virtual void setSOLinger(bool enable, int linger) throw (SocketException);
55  virtual unsigned long getReadTimeoutMillis() throw (SocketException);
56  virtual void setReadTimeoutMillis(unsigned long timeout) throw (SocketException);
57 
58  virtual int read(unsigned char *buffer, unsigned long length)
59  throw (BusTransferException);
60  virtual int write(const unsigned char *buffer, unsigned long length)
61  throw (BusTransferException);
62 
63  private:
64  int sock;
65  bool bound;
66  bool closed;
67  Inet4Address address;
68  };
69 }
70 
71 #endif /* SEABREEZE_NATIVESOCKETPOSIX_H */
Definition: SocketException.h:37
Definition: BusTransferException.h:41
Definition: BusException.h:43
Definition: UnknownHostException.h:37
Definition: Inet4Address.h:44
Definition: Socket.h:44
Definition: NativeSocketPOSIX.h:39
Definition: BusConnectException.h:42
Encapsulates all SeaBreeze classes.
Definition: DeviceFactory.h:42