mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
more published interfaces
This commit is contained in:
parent
b8bb953a34
commit
79772845e3
@ -64,9 +64,8 @@ protected:
|
|||||||
inline void ClearAll(void);
|
inline void ClearAll(void);
|
||||||
|
|
||||||
inline bool SendMessageBufferOnly(Datagram &msg); // do not use this .. this is a way for the the COnnecting UPcall to drop messages in queue first..
|
inline bool SendMessageBufferOnly(Datagram &msg); // do not use this .. this is a way for the the COnnecting UPcall to drop messages in queue first..
|
||||||
public:
|
|
||||||
inline bool GetMessage(Datagram &val);
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
|
inline bool GetMessage(Datagram &val);
|
||||||
inline bool DoConnect(void); // all the real state magic is in here
|
inline bool DoConnect(void); // all the real state magic is in here
|
||||||
inline bool IsConnected(void);
|
inline bool IsConnected(void);
|
||||||
inline Buffered_DatagramConnection(bool do_blocking_writes, int rbufsize, int wbufsize, int write_flush_point) ;
|
inline Buffered_DatagramConnection(bool do_blocking_writes, int rbufsize, int wbufsize, int write_flush_point) ;
|
||||||
@ -245,14 +244,14 @@ inline void Buffered_DatagramConnection::ClearAddresses(void)
|
|||||||
_Addresslist.clear();
|
_Addresslist.clear();
|
||||||
}
|
}
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function name : Buffered_DatagramConnection::GetMessageInternal
|
// Function name : Buffered_DatagramConnection::GetMessage
|
||||||
// Description : read a message
|
// Description : read a message
|
||||||
//
|
//
|
||||||
// false means something bad happened..
|
// false means something bad happened..
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Return type : inline bool
|
// Return type : inline bool
|
||||||
// Argument : DataGram **val
|
// Argument : Datagram &val
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
inline bool Buffered_DatagramConnection::GetMessage(Datagram &val)
|
inline bool Buffered_DatagramConnection::GetMessage(Datagram &val)
|
||||||
{
|
{
|
||||||
|
@ -20,24 +20,24 @@ public:
|
|||||||
const AddressType & GetAddressInfo() const { return _addr; }
|
const AddressType & GetAddressInfo() const { return _addr; }
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
|
|
||||||
Socket_Address(short port = 0);
|
inline Socket_Address(short port = 0);
|
||||||
Socket_Address(const Socket_Address &inaddr);
|
inline Socket_Address(const Socket_Address &inaddr);
|
||||||
|
|
||||||
virtual ~Socket_Address();
|
inline virtual ~Socket_Address();
|
||||||
|
|
||||||
bool set_any_IP(int port);
|
inline bool set_any_IP(int port);
|
||||||
bool set_port(int port);
|
inline bool set_port(int port);
|
||||||
bool set_broadcast(int port);
|
inline bool set_broadcast(int port);
|
||||||
|
|
||||||
bool set_host(const std::string &hostname, int port) ;
|
inline bool set_host(const std::string &hostname, int port) ;
|
||||||
bool set_host(const std::string &hostname) ;
|
inline bool set_host(const std::string &hostname) ;
|
||||||
bool set_host(unsigned int ip4adr, int port);
|
inline bool set_host(unsigned int ip4adr, int port);
|
||||||
void clear();
|
inline void clear();
|
||||||
|
|
||||||
unsigned short get_port() const;
|
inline unsigned short get_port() const;
|
||||||
std::string get_ip() const ;
|
inline std::string get_ip() const ;
|
||||||
std::string get_ip_port() const;
|
inline std::string get_ip_port() const;
|
||||||
unsigned long GetIPAddressRaw() const;
|
inline unsigned long GetIPAddressRaw() const;
|
||||||
|
|
||||||
inline bool operator== (const Socket_Address &in) const;
|
inline bool operator== (const Socket_Address &in) const;
|
||||||
inline bool operator < (const Socket_Address &in) const;
|
inline bool operator < (const Socket_Address &in) const;
|
||||||
|
@ -12,12 +12,20 @@ class EXPCL_PANDA Socket_UDP_Outgoing : public Socket_IP
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
|
inline Socket_UDP_Outgoing() { }
|
||||||
|
|
||||||
// use this interface for a tagreted UDP connection
|
// use this interface for a tagreted UDP connection
|
||||||
inline bool InitToAddress(Socket_Address & address);
|
inline bool InitToAddress(Socket_Address & address);
|
||||||
|
public:
|
||||||
inline bool Send(const char * data, int len);
|
inline bool Send(const char * data, int len);
|
||||||
|
PUBLISHED:
|
||||||
|
inline bool Send(const string &data);
|
||||||
// use this interface for a none tagreted UDP connection
|
// use this interface for a none tagreted UDP connection
|
||||||
inline bool InitNoAddress();
|
inline bool InitNoAddress();
|
||||||
|
public:
|
||||||
inline bool SendTo(const char * data, int len, const Socket_Address & address);
|
inline bool SendTo(const char * data, int len, const Socket_Address & address);
|
||||||
|
PUBLISHED:
|
||||||
|
inline bool SendTo(const string &data, const Socket_Address & address);
|
||||||
inline bool SetToBroadCast();
|
inline bool SetToBroadCast();
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
@ -67,6 +75,7 @@ inline bool Socket_UDP_Outgoing::InitNoAddress()
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function name : Socket_UDP_Outgoing::Send
|
// Function name : Socket_UDP_Outgoing::Send
|
||||||
// Description : Send data to connected address
|
// Description : Send data to connected address
|
||||||
@ -77,8 +86,21 @@ inline bool Socket_UDP_Outgoing::InitNoAddress()
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
inline bool Socket_UDP_Outgoing::Send(const char * data, int len)
|
inline bool Socket_UDP_Outgoing::Send(const char * data, int len)
|
||||||
{
|
{
|
||||||
return (DO_SOCKET_WRITE(_socket, data, len) == len);
|
return (DO_SOCKET_WRITE(_socket, data, len) == len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function name : Socket_UDP_Outgoing::Send
|
||||||
|
// Description : Send data to connected address
|
||||||
|
//
|
||||||
|
// Return type : inline bool
|
||||||
|
// Argument : const string &data
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
inline bool Socket_UDP_Outgoing::Send(const string &data)
|
||||||
|
{
|
||||||
|
return Send(data.data(), data.size());
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function name : Socket_UDP_Outgoing::SendTo
|
// Function name : Socket_UDP_Outgoing::SendTo
|
||||||
// Description : Send data to specified address
|
// Description : Send data to specified address
|
||||||
@ -93,4 +115,17 @@ inline bool Socket_UDP_Outgoing::SendTo(const char * data, int len, const Socket
|
|||||||
return (DO_SOCKET_WRITE_TO(_socket, data, len, &address.GetAddressInfo()) == len);
|
return (DO_SOCKET_WRITE_TO(_socket, data, len, &address.GetAddressInfo()) == len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function name : Socket_UDP_Outgoing::SendTo
|
||||||
|
// Description : Send data to specified address
|
||||||
|
//
|
||||||
|
// Return type : inline bool
|
||||||
|
// Argument : const string &data
|
||||||
|
// Argument : NetAddress & address
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
inline bool Socket_UDP_Outgoing::SendTo(const string &data, const Socket_Address & address)
|
||||||
|
{
|
||||||
|
return SendTo(data.data(), data.size(), address);
|
||||||
|
}
|
||||||
|
|
||||||
#endif //__SOCKET_UDP_OUTGOING_H__
|
#endif //__SOCKET_UDP_OUTGOING_H__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user