Permalink
Browse files

Added htons and ntohs to Socket

  • Loading branch information...
1 parent 4cc2138 commit c9e06cd0e3f27c6b4548bd0504495cd67357d9f7 John committed Oct 26, 2012
Showing with 10 additions and 0 deletions.
  1. +8 −0 Socket.c
  2. +2 −0 Socket.h
View
@@ -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
@@ -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

0 comments on commit c9e06cd

Please sign in to comment.