Rise
The Vieneo Province
Loading...
Searching...
No Matches
steamnetworkingfakeip.h
Go to the documentation of this file.
1//====== Copyright Valve Corporation, All rights reserved. ====================
2
3#ifndef STEAMNETWORKINGFAKEIP_H
4#define STEAMNETWORKINGFAKEIP_H
5#pragma once
6
8#include "steam_api_common.h"
9
10// It is HIGHLY recommended to limit messages sent via Fake UDP port to this
11// value. The purpose of a Fake UDP port is to make porting ordinary ad-hoc UDP
12// code easier. Although the real MTU might be higher than this, this particular
13// conservative value is chosen so that fragmentation won't be occurring and
14// hiding performance problems from you.
16
17// Messages larger than this size are not allowed and cannot be sent
18// via Fake UDP port.
20
21//-----------------------------------------------------------------------------
28
30{
31public:
36 virtual void DestroyFakeUDPPort() = 0;
37
59 virtual EResult SendMessageToFakeIP( const SteamNetworkingIPAddr &remoteAddress, const void *pData, uint32 cbData, int nSendFlags ) = 0;
60
67 virtual int ReceiveMessages( SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
68
77 virtual void ScheduleCleanup( const SteamNetworkingIPAddr &remoteAddress ) = 0;
78};
79
81#if defined( VALVE_CALLBACK_PACK_SMALL )
82#pragma pack( push, 4 )
83#elif defined( VALVE_CALLBACK_PACK_LARGE )
84#pragma pack( push, 8 )
85#else
86#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE"
87#endif
88
132
133#pragma pack( pop )
134
135#endif // _H
virtual EResult SendMessageToFakeIP(const SteamNetworkingIPAddr &remoteAddress, const void *pData, uint32 cbData, int nSendFlags)=0
virtual void ScheduleCleanup(const SteamNetworkingIPAddr &remoteAddress)=0
virtual int ReceiveMessages(SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages)=0
virtual void DestroyFakeUDPPort()=0
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
@ k_iSteamNetworkingSocketsCallbacks
constexpr int k_cbSteamNetworkingSocketsFakeUDPPortMaxMessageSize
constexpr int k_cbSteamNetworkingSocketsFakeUDPPortRecommendedMTU
unsigned short uint16
Definition steamtypes.h:56
Callback struct used to notify when a connection has changed state.
uint16 m_unPorts[k_nMaxReturnPorts]
A message that has been received.