+ ISteamNetworkingSockets *self, HSteamListenSocket hSocket );
+
+EResult SteamAPI_ISteamNetworkingSockets_SendMessageToConnection(
+ ISteamNetworkingSockets* self,
+ HSteamNetConnection hConn, const void *pData, u32 cbData, int nSendFlags,
+ i64 * pOutMessageNumber );
+
+void SteamAPI_ISteamNetworkingSockets_SendMessages(
+ ISteamNetworkingSockets* self,
+ int nMessages, SteamNetworkingMessage_t *const *pMessages,
+ i64 *pOutMessageNumberOrResult );
+
+EResult SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection(
+ ISteamNetworkingSockets* self,
+ HSteamNetConnection hConn );
+
+int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection(
+ ISteamNetworkingSockets* self,
+ HSteamNetConnection hConn,
+ SteamNetworkingMessage_t **ppOutMessages,
+ int nMaxMessages );
+
+/*
+ * Poll Groups
+ */
+
+HSteamNetPollGroup SteamAPI_ISteamNetworkingSockets_CreatePollGroup(
+ ISteamNetworkingSockets *self );
+
+int SteamAPI_ISteamNetworkingSockets_DestroyPollGroup(
+ ISteamNetworkingSockets *self,
+ HSteamNetPollGroup hPollGroup );
+
+int SteamAPI_ISteamNetworkingSockets_SetConnectionPollGroup(
+ ISteamNetworkingSockets *self,
+ HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup );
+
+int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(
+ ISteamNetworkingSockets *self,
+ HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages,
+ int nMaxMessages );
+/*
+ * Returns basic information about the high-level state of the connection.
+ * Returns false if the connection handle is invalid.
+ */
+int SteamAPI_ISteamNetworkingSockets_GetConnectionInfo(
+ ISteamNetworkingSockets* self,
+ HSteamNetConnection hConn, SteamNetConnectionInfo_t * pInfo );
+
+int SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus(
+ ISteamNetworkingSockets* self,
+ HSteamNetConnection hConn, char *pszBuf, int cbBuf );
+
+int SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress(
+ ISteamNetworkingSockets* self,
+ HSteamListenSocket hSocket, SteamNetworkingIPAddr *address );
+
+enum{ k_cchSteamNetworkingMaxConnectionCloseReason = 128 };
+enum{ k_cchSteamNetworkingMaxConnectionDescription = 128 };
+enum{ k_cchSteamNetworkingMaxConnectionAppName = 32 };
+enum{ k_nSteamNetworkConnectionInfoFlags_Unauthenticated = 1 };
+enum{ k_nSteamNetworkConnectionInfoFlags_Unencrypted = 2 };
+enum{ k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers = 4 };
+enum{ k_nSteamNetworkConnectionInfoFlags_Fast = 8 };
+enum{ k_nSteamNetworkConnectionInfoFlags_Relayed = 16 };
+enum{ k_nSteamNetworkConnectionInfoFlags_DualWifi = 32 };
+
+/* Describe the state of a connection. */
+typedef struct SteamNetConnectionInfo_t SteamNetConnectionInfo_t;
+struct SteamNetConnectionInfo_t
+{
+ /*
+ * Who is on the other end? Depending on the connection type and phase of the
+ * connection, we might not know
+ */
+ SteamNetworkingIdentity m_identityRemote;
+
+ /* Arbitrary user data set by the local application code */
+ i64 m_nUserData;
+
+ /*
+ * Handle to listen socket this was connected on, or
+ * k_HSteamListenSocket_Invalid if we initiated the connection
+ */
+ HSteamListenSocket m_hListenSocket;
+
+ /*
+ * Remote address. Might be all 0's if we don't know it, or if this is N/A.
+ * (E.g. Basically everything except direct UDP connection.)
+ */
+ SteamNetworkingIPAddr m_addrRemote;
+ u16 m__pad1;
+
+ /* What data center is the remote host in? (0 if we don't know.) */
+ SteamNetworkingPOPID m_idPOPRemote;
+
+ /*
+ * What relay are we using to communicate with the remote host?
+ * (0 if not applicable.)
+ */
+ SteamNetworkingPOPID m_idPOPRelay;
+
+ /* High level state of the connection */
+ ESteamNetworkingConnectionState m_eState;
+
+ /*
+ * Basic cause of the connection termination or problem.
+ * See ESteamNetConnectionEnd for the values used
+ */
+ int m_eEndReason;
+
+ /*
+ * Human-readable, but non-localized explanation for connection
+ * termination or problem. This is intended for debugging /
+ * diagnostic purposes only, not to display to users. It might
+ * have some details specific to the issue.
+ */
+ char m_szEndDebug[ k_cchSteamNetworkingMaxConnectionCloseReason ];
+
+ /*
+ * Debug description. This includes the internal connection ID,
+ * connection type (and peer information), and any name
+ * given to the connection by the app. This string is used in various
+ * internal logging messages.
+ *
+ * Note that the connection ID *usually* matches the HSteamNetConnection
+ * handle, but in certain cases with symmetric connections it might not.
+ */
+ char m_szConnectionDescription
+ [ k_cchSteamNetworkingMaxConnectionDescription ];
+
+ /* Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx */
+ int m_nFlags;
+
+ /* Internal stuff, room to change API easily */
+ u32 reserved[63];
+};
+
+/*
+ * Quick connection state, pared down to something you could call
+ * more frequently without it being too big of a perf hit.
+ */
+struct SteamNetConnectionRealTimeStatus_t
+{
+ /* High level state of the connection */
+ ESteamNetworkingConnectionState m_eState;
+
+ /* Current ping (ms) */
+ int m_nPing;
+
+ /*
+ * Connection quality measured locally, 0...1.
+ * (Percentage of packets delivered end-to-end in order).
+ */
+ float m_flConnectionQualityLocal;
+
+ /* Packet delivery success rate as observed from remote host */
+ float m_flConnectionQualityRemote;
+
+ /* Current data rates from recent history. */
+ float m_flOutPacketsPerSec;
+ float m_flOutBytesPerSec;
+ float m_flInPacketsPerSec;
+ float m_flInBytesPerSec;
+
+ /*
+ * Estimate rate that we believe that we can send data to our peer.
+ * Note that this could be significantly higher than m_flOutBytesPerSec,
+ * meaning the capacity of the channel is higher than you are sending data.
+ * (That's OK!)
+ */
+ int m_nSendRateBytesPerSecond;
+
+ /*
+ * Number of bytes pending to be sent. This is data that you have recently
+ * requested to be sent but has not yet actually been put on the wire. The
+ * reliable number ALSO includes data that was previously placed on the wire,
+ * but has now been scheduled for re-transmission. Thus, it's possible to
+ * observe m_cbPendingReliable increasing between two checks, even if no
+ * calls were made to send reliable data between the checks. Data that is
+ * awaiting the Nagle delay will appear in these numbers.
+ */
+ int m_cbPendingUnreliable;
+ int m_cbPendingReliable;
+
+ /*
+ * Number of bytes of reliable data that has been placed the wire, but
+ * for which we have not yet received an acknowledgment, and thus we may
+ * have to re-transmit.
+ */
+ int m_cbSentUnackedReliable;
+
+ /*
+ * If you queued a message right now, approximately how long would that
+ * message wait in the queue before we actually started putting its data on
+ * the wire in a packet?
+ *
+ * In general, data that is sent by the application is limited by the
+ * bandwidth of the channel. If you send data faster than this, it must be
+ * queued and put on the wire at a metered rate. Even sending a small amount
+ * of data (e.g. a few MTU, say ~3k) will require some of the data to be
+ * delayed a bit.
+ *
+ * Ignoring multiple lanes,the estimated delay will be approximately equal to
+ *
+ * ( m_cbPendingUnreliable+m_cbPendingReliable ) /
+ * m_nSendRateBytesPerSecond
+ *
+ * plus or minus one MTU. It depends on how much time has elapsed since the
+ * last packet was put on the wire. For example, the queue might have *just*
+ * been emptied, and the last packet placed on the wire, and we are exactly
+ * up against the send rate limit. In that case we might need to wait for
+ * one packet's worth of time to elapse before we can send again. On the
+ * other extreme, the queue might have data in it waiting for Nagle. (This
+ * will always be less than one packet, because as soon as we have a complete
+ * packet we would send it.) In that case, we might be ready to send data
+ * now, and this value will be 0.
+ *
+ * This value is only valid if multiple lanes are not used. If multiple lanes
+ * are in use, then the queue time will be different for each lane, and you
+ * must use the value in SteamNetConnectionRealTimeLaneStatus_t.
+ *
+ * Nagle delay is ignored for the purposes of this calculation.
+ */
+ SteamNetworkingMicroseconds m_usecQueueTime;
+
+ // Internal stuff, room to change API easily
+ u32 reserved[16];
+};