/// <summary> /// <para> returns true to describe how the socket ended up connecting</para> /// </summary> public static EsNetSocketConnectionType GetSocketConnectionType(SNetSocket hSocket) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_GetSocketConnectionType(hSocket)); }
/// <summary> /// <para> max packet size, in bytes</para> /// </summary> public static int GetMaxPacketSize(SNetSocket hSocket) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_GetMaxPacketSize(hSocket)); }
/// <summary> /// <para> retrieves data from any socket that has been connected off this listen socket</para> /// <para> fills in pubDest with the contents of the message</para> /// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para> /// <para> if *pcubMsgSize < Dest, only partial data is written</para> /// <para> returns false if no data is available</para> /// <para> fills out *phSocket with the socket that data is available on</para> /// </summary> public static bool RetrieveData(SNetListenSocket hListenSocket, IntPtr pubDest, uint Dest, out uint pcubMsgSize, out SNetSocket phSocket) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_RetrieveData(hListenSocket, pubDest, Dest, out pcubMsgSize, out phSocket)); }
/// <summary> /// <para> returns information about the specified socket, filling out the contents of the pointers</para> /// </summary> public static bool GetSocketInfo(SNetSocket hSocket, out SteamId pSteamIDRemote, out int peSocketStatus, out uint punIPRemote, out ushort punPortRemote) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_GetSocketInfo(hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote)); }
/// <summary> /// <para> checks for data from any socket that has been connected off this listen socket</para> /// <para> returns false if there is no data remaining</para> /// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para> /// <para> fills out *phSocket with the socket that data is available on</para> /// </summary> public static bool IsDataAvailable(SNetListenSocket hListenSocket, out uint pcubMsgSize, out SNetSocket phSocket) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_IsDataAvailable(hListenSocket, out pcubMsgSize, out phSocket)); }
/// <summary> /// <para> fills in pubDest with the contents of the message</para> /// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para> /// <para> if *pcubMsgSize < Dest, only partial data is written</para> /// <para> returns false if no data is available</para> /// </summary> public static bool RetrieveDataFromSocket(SNetSocket hSocket, IntPtr pubDest, uint Dest, out uint pcubMsgSize) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_RetrieveDataFromSocket(hSocket, pubDest, Dest, out pcubMsgSize)); }
/// <summary> /// <para> receiving data</para> /// <para> returns false if there is no data remaining</para> /// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para> /// </summary> public static bool IsDataAvailableOnSocket(SNetSocket hSocket, out uint pcubMsgSize) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(hSocket, out pcubMsgSize)); }
/// <summary> /// <para> sending data</para> /// <para> must be a handle to a connected socket</para> /// <para> data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets</para> /// <para> use the reliable flag with caution; although the resend rate is pretty aggressive,</para> /// <para> it can still cause stalls in receiving data (like TCP)</para> /// </summary> public static bool SendDataOnSocket(SNetSocket hSocket, IntPtr pubData, uint Data, bool bReliable) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_SendDataOnSocket(hSocket, pubData, Data, bReliable)); }
/// <summary> /// <para> disconnects the connection to the socket, if any, and invalidates the handle</para> /// <para> any unread data on the socket will be thrown away</para> /// <para> if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect</para> /// </summary> public static bool DestroySocket(SNetSocket hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableClient(); return(NativeMethods.ISteamNetworking_DestroySocket(hSocket, bNotifyRemoteEnd)); }