Changeset 178 in flair-src for trunk/lib/FlairCore/src/UdpSocket.cpp
- Timestamp:
- 05/19/17 16:15:52 (6 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/UdpSocket.cpp
r177 r178 4 4 // %flair:license} 5 5 // created: 2013/11/17 6 // filename: Socket.cpp6 // filename: UdpSocket.cpp 7 7 // 8 8 // author: Guillaume Sanahuja … … 15 15 // 16 16 /*********************************************************************/ 17 #include " Socket.h"18 #include " Socket_impl.h"17 #include "UdpSocket.h" 18 #include "UdpSocket_impl.h" 19 19 #include <FrameworkManager.h> 20 20 #include <string.h> … … 26 26 namespace core { 27 27 28 Socket::Socket(const Object *parent, string name, uint16_t port)28 UdpSocket::UdpSocket(const Object *parent, string name, uint16_t port) 29 29 : Object(parent, name) { 30 pimpl_ = new Socket_impl(this, name, port);30 pimpl_ = new UdpSocket_impl(this, name, port); 31 31 } 32 32 33 Socket::Socket(const Object *parent, string name, string address,33 UdpSocket::UdpSocket(const Object *parent, string name, string address, 34 34 bool broadcast) 35 35 : Object(parent, name) { 36 pimpl_ = new Socket_impl(this, name, address, broadcast);36 pimpl_ = new UdpSocket_impl(this, name, address, broadcast); 37 37 } 38 38 39 Socket::~Socket() { delete pimpl_; }39 UdpSocket::~UdpSocket() { delete pimpl_; } 40 40 41 void Socket::SendMessage(const char *message, size_t message_len) {41 void UdpSocket::SendMessage(const char *message, size_t message_len) { 42 42 pimpl_->SendMessage(message, message_len); 43 43 } 44 44 45 void Socket::SendMessage(string message) { pimpl_->SendMessage(message); }45 void UdpSocket::SendMessage(string message) { pimpl_->SendMessage(message); } 46 46 47 ssize_t Socket::RecvMessage(char *buf, size_t buf_len, Time timeout, char *src,47 ssize_t UdpSocket::RecvMessage(char *buf, size_t buf_len, Time timeout, char *src, 48 48 size_t *src_len) { 49 49 return pimpl_->RecvMessage(buf, buf_len, timeout, src, src_len); 50 50 } 51 51 52 void Socket::NetworkToHost(char *data, size_t dataSize) {52 void UdpSocket::NetworkToHost(char *data, size_t dataSize) { 53 53 if (core::IsBigEndian()) 54 54 return; … … 69 69 } 70 70 71 void Socket::HostToNetwork(char *data, size_t dataSize) {71 void UdpSocket::HostToNetwork(char *data, size_t dataSize) { 72 72 if (IsBigEndian()) 73 73 return;
Note:
See TracChangeset
for help on using the changeset viewer.