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