summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-07-18 01:40:22 -0400
committerjoe <joe@jerkface.net>2013-07-18 01:40:22 -0400
commita649e76487763ba5ac080240dd2b0a056cbd8fd1 (patch)
tree34c5d3e11e9c558745ac22a22e61012c82af5fd4
parent75fe2e454f73975e0261051016d4f4557746b6bd (diff)
More methods in SocketLike
-rw-r--r--Presence/SocketLike.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Presence/SocketLike.hs b/Presence/SocketLike.hs
index d2ff84f6..30a8fe07 100644
--- a/Presence/SocketLike.hs
+++ b/Presence/SocketLike.hs
@@ -5,6 +5,11 @@ module SocketLike
5 , getPeerName 5 , getPeerName
6 , getPeerCred 6 , getPeerCred
7 , socketPort 7 , socketPort
8 , sIsConnected
9 , sIsBound
10 , sIsListening
11 , sIsReadable
12 , sIsWritable
8 , RestrictedSocket 13 , RestrictedSocket
9 , restrictSocket 14 , restrictSocket
10 , PortNumber 15 , PortNumber
@@ -25,12 +30,22 @@ class SocketLike sock where
25 getPeerName :: sock -> IO SockAddr 30 getPeerName :: sock -> IO SockAddr
26 getPeerCred :: sock -> IO (CUInt, CUInt, CUInt) 31 getPeerCred :: sock -> IO (CUInt, CUInt, CUInt)
27 socketPort :: sock -> IO PortNumber 32 socketPort :: sock -> IO PortNumber
33 sIsConnected :: sock -> IO Bool
34 sIsBound :: sock -> IO Bool
35 sIsListening :: sock -> IO Bool
36 sIsReadable :: sock -> IO Bool
37 sIsWritable :: sock -> IO Bool
28 38
29instance SocketLike NS.Socket where 39instance SocketLike NS.Socket where
30 getSocketName = NS.getSocketName 40 getSocketName = NS.getSocketName
31 getPeerName = NS.getPeerName 41 getPeerName = NS.getPeerName
32 getPeerCred = NS.getPeerCred 42 getPeerCred = NS.getPeerCred
33 socketPort = NS.socketPort 43 socketPort = NS.socketPort
44 sIsConnected = NS.sIsConnected
45 sIsBound = NS.sIsBound
46 sIsListening = NS.sIsListening
47 sIsReadable = NS.sIsReadable
48 sIsWritable = NS.sIsWritable
34 49
35newtype RestrictedSocket = Restricted NS.Socket deriving SocketLike 50newtype RestrictedSocket = Restricted NS.Socket deriving SocketLike
36 51