欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

udphardlink.h

这是整套横扫千军3D版游戏的源码
H
字号:
#ifndef _UDPHARDLINK
#define _UDPHARDLINK

#include "UDPSocket.h"

namespace netcode {

/**
@brief Simple Class for communication with a socket location
This is simply a UDPSocket which has been connect()'ed to a specific address and will send / recieve only to / from this address
@author Karl-Robert Ernst
*/
class UDPHardlink : private UDPSocket
{
public:
	/**
	@brief Constructor
	@param address The DNS or IP of the other side
	@param remoteport the port the other side use
	@param port The port we will use here
	@param range if $port is blocked, try port +1, +2, ... +range
	@throw network_error when hostname cannot be resolved
	*/
	UDPHardlink(const char* const address, const unsigned remoteport, const int port, const unsigned range=0);

	/**
	@brief Send some data
	*/
	void Send(const unsigned char* const buf, const unsigned dataLength) const;
	
	/**
	@brief Recieve some data
	*/
	unsigned Recv(unsigned char* buf, const unsigned bufLength) const;

private:

};



} // namespace netcode

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -