SHARE
TWEET

Socket.hs

a guest Dec 2nd, 2013 10 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Socket(sendData,recvData) where
  2.         import System.IO
  3.         import qualified Commands
  4.         import qualified Network
  5.        
  6.         type ServerName = String
  7.         type Port = Int
  8.         type ChannelServ = String
  9.         type Nick = String
  10.        
  11.         -- Connect
  12.         connectSocket :: ServerName -> Port -> ChannelServ -> IO()
  13.         connectSocket s p c= do
  14.                                 socketClient <- connectTo s (PortNumber (fromIntegral Port))
  15.                                 write socketClient (Commands.getNick "MiNombre")
  16.                                 write socketClient (Commands.getUser "UserName" "irc.freenode.net" "ServerName" "MiNombre")
  17.                                 write socketClient (Commands.joinIrc "#channelTest")
  18.                                 listen socketClient
  19.                                 return()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top