haskell - How to use createTransport? -
i'm following cloud-haskell tutorial , stuck @ createtransport
. seems me i'm able open transport @ 127.0.0.1 server , can't open transport client connect server. i've tried using 2 machines, using curl ifconfig.me
ip address, however, createtransport
not create transport me. ideas?
edit: locally working now.
my program exact same tutorial, trying connect between 2 machines:
curl ifconfig.me
returns 101.119.27.24
command line server:
serverclientserver 101.119.27.24 9000
error returned:
bind: unsupported operation (cannot assign rerquested address)
edit: server code followed:
main :: io () main = [host, port] <- getargs serverdone <- newemptymvar right transport <- createtransport host port right endpoint <- newendpoint transport forkio $ echoserver endpoint serverdone putstrln $ "echo server started @ " ++ show (address endpoint) readmvar serverdone `onctrlc` closetransport transport
the echoserver
, onctrlc
functions defined in module.
i changed right transport <- createtransport host port
into
t <- createtransport host port defaulttcpparameters let transport = case t of (right t) -> t (left e) -> error $ show e
so can see error message is.
community-wiki answer based on comments:
you behind nat device (such broadband router) , address in question belongs device, not computer. cannot bind it.
try ifconfig
command (ipconfig
on windows). address on local network, or several addresses on several networks (e.g. wired , wireless). if have typical home network connected broadband router, these addresses visible home network(s) not internet. make server accessible outside need configure "hole" in router. basic networking stuff, have learn if want "cloudy".
Comments
Post a Comment