23.06.2014 - PICodeParser, PICodeInfo, PIConnection, new binary "pip_cmg"
This commit is contained in:
21
piethernet.h
21
piethernet.h
@@ -83,23 +83,23 @@ public:
|
||||
|
||||
|
||||
//! Returns read address in format "i.i.i.i:p"
|
||||
PIString readAddress() {return path();}
|
||||
PIString readAddress() const {return path();}
|
||||
|
||||
//! Returns read IP
|
||||
PIString readIP() {parseAddress(path(), &ip_, &port_); return ip_;}
|
||||
PIString readIP() const {parseAddress(path(), &ip_, &port_); return ip_;}
|
||||
|
||||
//! Returns read port
|
||||
int readPort() {parseAddress(path(), &ip_, &port_); return port_;}
|
||||
int readPort() const {parseAddress(path(), &ip_, &port_); return port_;}
|
||||
|
||||
|
||||
//! Returns send address in format "i.i.i.i:p"
|
||||
PIString sendAddress() {return ip_s + ":" + PIString::fromNumber(port_s);}
|
||||
PIString sendAddress() const {return ip_s + ":" + PIString::fromNumber(port_s);}
|
||||
|
||||
//! Returns send IP
|
||||
PIString sendIP() {return ip_s;}
|
||||
PIString sendIP() const {return ip_s;}
|
||||
|
||||
//! Returns send port
|
||||
int sendPort() {return port_s;}
|
||||
int sendPort() const {return port_s;}
|
||||
|
||||
|
||||
//! Set parameters to "parameters_". You should to reopen %PIEthernet to apply them
|
||||
@@ -179,6 +179,8 @@ public:
|
||||
//! Send data "data" to address \a sendAddress() for UDP or \a readAddress() for TCP_Client
|
||||
int write(const PIByteArray & data) {return write(data.data(), data.size_s());}
|
||||
|
||||
PIString constructFullPath() const;
|
||||
|
||||
EVENT1(newConnection, PIEthernet * , client)
|
||||
EVENT0(connected)
|
||||
EVENT1(disconnected, bool, withError)
|
||||
@@ -327,10 +329,11 @@ protected:
|
||||
#endif
|
||||
|
||||
|
||||
int sock, sock_s, port_, port_s, port_c, wrote;
|
||||
int sock, sock_s, wrote;
|
||||
mutable int port_, port_s, port_c;
|
||||
bool connected_, connecting_;
|
||||
sockaddr_in addr_, saddr_;
|
||||
PIString ip_, ip_s, ip_c;
|
||||
mutable PIString ip_, ip_s, ip_c;
|
||||
PIThread server_thread_;
|
||||
PIVector<PIEthernet * > clients_;
|
||||
PIQueue<PIString> mcast_queue;
|
||||
@@ -341,7 +344,7 @@ protected:
|
||||
|
||||
private:
|
||||
static void server_func(void * eth);
|
||||
void setType(Type t) {setProperty("type", (int)t); if (isOpened()) {closeDevice(); init(); openDevice();}}
|
||||
void setType(Type t, bool reopen = true) {setProperty("type", (int)t); if (reopen && isOpened()) {closeDevice(); init(); openDevice();}}
|
||||
|
||||
static std::string ethErrorString() {
|
||||
#ifdef WINDOWS
|
||||
|
||||
Reference in New Issue
Block a user