Skip to content

codecop/Socket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket

Interface to network communication. Sockets will auto yield to other coroutines while waiting on a request. All blocking operations use the timeout settings of the socket. Reads are appended to the socket's read buffer which can be accessed using the readBuffer method.

Example:

socket := Socket clone setHost("www.google.com") setPort(80) connect
if(socket error) then( write(socket error, "\n"); exit)

socket write("GET /\n\n")

while(socket read, Nop)
if(socket error) then(write(socket error, "\n"); exit)

write("read ", socket readBuffer length, " bytes\n")

Installation

libevent should be installed and foundable in your system. Then:

eerie install https://github.com/IoLanguage/Socket.git

About

Interface to network communication. Patch code.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • C 66.3%
  • Io 33.7%