git-svn-id: svn://db.shs.com.ru/pip@750 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-02-11 10:04:47 +00:00
parent fc8d1c253b
commit dccb5cc7ea
3 changed files with 22 additions and 18 deletions

View File

@@ -315,6 +315,8 @@ public:
bool send(const Address & addr, const PIByteArray & data, bool threaded = false) {addr_s = addr; if (threaded) {writeThreaded(data); return true;} return (write(data) == data.size_s());}
virtual bool canWrite() const {return mode() & WriteOnly;}
int socket() const {return sock;}
EVENT1(newConnection, PIEthernet * , client)
EVENT0(connected)
@@ -500,15 +502,15 @@ private:
static void server_func(void * eth);
void setType(Type t, bool reopen = true) {setProperty(PIStringAscii("type"), (int)t); if (reopen && isOpened()) {closeDevice(); init(); openDevice();}}
inline static int ethErrorCore();
inline static PIString ethErrorString();
inline static int ethRecv(int sock, void * buf, int size, int flags = 0);
inline static int ethRecvfrom(int sock, void * buf, int size, int flags, sockaddr * addr);
inline static int ethSendto(int sock, const void * buf, int size, int flags, sockaddr * addr, int addr_len);
inline static void ethClosesocket(int sock, bool shutdown);
inline static int ethSetsockopt(int sock, int level, int optname, const void * optval, int optlen);
inline static int ethSetsockoptInt(int sock, int level, int optname, int value = 1);
inline static int ethSetsockoptBool(int sock, int level, int optname, bool value = true);
static int ethErrorCore();
static PIString ethErrorString();
static int ethRecv(int sock, void * buf, int size, int flags = 0);
static int ethRecvfrom(int sock, void * buf, int size, int flags, sockaddr * addr);
static int ethSendto(int sock, const void * buf, int size, int flags, sockaddr * addr, int addr_len);
static void ethClosesocket(int sock, bool shutdown);
static int ethSetsockopt(int sock, int level, int optname, const void * optval, int optlen);
static int ethSetsockoptInt(int sock, int level, int optname, int value = 1);
static int ethSetsockoptBool(int sock, int level, int optname, bool value = true);
};