https://github.com/iolanguage/socket
https://github.com/iolanguage/socket
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/iolanguage/socket
- Owner: IoLanguage
- License: bsd-3-clause
- Created: 2018-03-11T12:01:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-12T17:54:28.000Z (about 8 years ago)
- Last Synced: 2025-01-21T00:48:44.762Z (over 1 year ago)
- Language: C
- Size: 68.4 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```Io
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
```