Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added htons and ntohs to Socket

  • Loading branch information...
commit c9e06cd0e3f27c6b4548bd0504495cd67357d9f7 1 parent 4cc2138
@Arke64 Arke64 authored
Showing with 10 additions and 0 deletions.
  1. +8 −0 Socket.c
  2. +2 −0  Socket.h
View
8 Socket.c
@@ -407,3 +407,11 @@ void SAL_Socket_UnsetSocketCallback(SAL_Socket* socket) {
SAL_Socket_CallbackWorker_Shutdown();
}
}
+
+uint16 SAL_Socket_HostToNetworkShort(uint16 value) {
+ return htons(value);
+}
+
+uint16 SAL_Socket_NetworkToHostShort(uint16 value) {
+ return ntohs(value);
+}
View
2  Socket.h
@@ -39,5 +39,7 @@ public uint32 SAL_Socket_Read(SAL_Socket* socket, uint8* const buffer, const uin
public uint32 SAL_Socket_Write(SAL_Socket* socket, const uint8* const toWrite, const uint32 writeAmount);
public void SAL_Socket_SetReadCallback(SAL_Socket* socket, SAL_Socket_ReadCallback callback, void* const state);
public void SAL_Socket_UnsetSocketCallback(SAL_Socket* socket);
+public uint16 SAL_Socket_HostToNetworkShort(uint16 value);
+public uint16 SAL_Socket_NetworkToHostShort(uint16 value);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.