8 Mar
2001
8 Mar
'01
5:26 p.m.
Alba Marina Lopez Arguelles writes:
- There's a function in the library Socket called connectTo and I would like to know how does it work 'from the inside'.
connectTo is in the Socket library, and it is implemented in terms of the lower level primitives from SocketPrim. It takes a hostname and port, and returns a normal Haskell Handle, on which you can use hGetLine and hPutStr as you would with a file or pipe. This is easiest way to open up a connection to a server and communicate with it.
- I also would like to know what does the function readSocket (from SocketPrim) return.
I don't recommend using readSocket. Using the normal Haskell I/O functions with a socket Handle should be enough. Cheers, Simon
9304
Age (days ago)
9304
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow