public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_SetLocalIPBinding(CSteamAPIContext.GetSteamClient(), ref unIP, usPort); }
/// <summary> /// <para> returns which local port the listen socket is bound to</para> /// <para> *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only</para> /// </summary> public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort)); }
public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec) { InteropHelp.TestIfAvailableClient(); return((SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec)); }
/// <summary> /// <para> returns information about the specified socket, filling out the contents of the pointers</para> /// </summary> public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_GetSocketInfo(CSteamAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote)); }
/// <summary> /// <para>//////////////////////////////////////////////////////////////////////////////////////////</para> /// <para> LISTEN / CONNECT connection-oriented interface functions</para> /// <para> These functions are more like a client-server TCP API. One side is the "server"</para> /// <para> and "listens" for incoming connections, which then must be "accepted." The "client"</para> /// <para> initiates a connection by "connecting." Sending and receiving is done through a</para> /// <para> connection handle.</para> /// <para> For a more UDP-style interface, where you do not track connection handles but</para> /// <para> simply send messages to a SteamID, use the UDP-style functions above.</para> /// <para> Both methods can send both reliable and unreliable methods.</para> /// <para>//////////////////////////////////////////////////////////////////////////////////////////</para> /// <para> creates a socket and listens others to connect</para> /// <para> will trigger a SocketStatusCallback_t callback on another client connecting</para> /// <para> nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports</para> /// <para> this can usually just be 0 unless you want multiple sets of connections</para> /// <para> unIP is the local IP address to bind to</para> /// <para> pass in 0 if you just want the default local IP</para> /// <para> unPort is the port to use</para> /// <para> pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only</para> /// </summary> public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableClient(); return((SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay)); }