Skip to content

Commit

Permalink
wrapped sf::Socket::Partial from the enum sf::Socket::Status
Browse files Browse the repository at this point in the history
  • Loading branch information
fccm committed Oct 24, 2019
1 parent f97b8b8 commit 51a2d70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SFTcpSocket.ml
Expand Up @@ -2,11 +2,13 @@ type t

exception Socket_Not_Ready
exception Socket_Disconnected
exception Socket_Partial
exception Socket_Error

let init () =
Callback.register_exception "SFTcpSocket.Socket_Not_Ready" Socket_Not_Ready;
Callback.register_exception "SFTcpSocket.Socket_Disconnected" Socket_Disconnected;
Callback.register_exception "SFTcpSocket.Socket_Partial" Socket_Partial;
Callback.register_exception "SFTcpSocket.Socket_Error" Socket_Error;
;;

Expand Down
2 changes: 2 additions & 0 deletions src/SFUdpSocket.ml
Expand Up @@ -2,11 +2,13 @@ type t

exception Socket_Not_Ready
exception Socket_Disconnected
exception Socket_Partial
exception Socket_Error

let init () =
Callback.register_exception "SFUdpSocket.Socket_Not_Ready" Socket_Not_Ready;
Callback.register_exception "SFUdpSocket.Socket_Disconnected" Socket_Disconnected;
Callback.register_exception "SFUdpSocket.Socket_Partial" Socket_Partial;
Callback.register_exception "SFUdpSocket.Socket_Error" Socket_Error;
;;

Expand Down
2 changes: 2 additions & 0 deletions src/cxx_stubs/SFSocket_stub.hpp
Expand Up @@ -9,6 +9,8 @@
case sf::Socket::Done: break; \
case sf::Socket::NotReady: \
caml_raise_constant(*caml_named_value(mod_name ".Socket_Not_Ready")); break; \
case sf::Socket::Partial: \
caml_raise_constant(*caml_named_value(mod_name ".Socket_Partial")); break; \
case sf::Socket::Disconnected: \
caml_raise_constant(*caml_named_value(mod_name ".Socket_Disconnected")); break; \
case sf::Socket::Error: \
Expand Down

0 comments on commit 51a2d70

Please sign in to comment.