![]() | ![]() | ![]() | open-connection | ![]() |
|
| host port
| [Generic Function] |
Purpose
Open a socket-stream connection to server host.
Method signatures
(host integer)
port
=> socket-stream
|
(host string) port
=> socket-stream
|
Package :portable-sockets
Module :portable-sockets
Arguments and values
| host | A 32-bit internet address or a string specifying the remote host | |
| port | An integer or a string specifying the service port | |
| socket-stream | A socket stream |
Returns
A socket stream.
Description
A host string can be either a host name or a
“dotted” IP address, such as "127.0.0.1"
String values available for specifying port are found in the operating
system's services file and labeled as being tcp services. On Unix
systems, the services file is /etc/servicesservicesWindows
See also
shutdown-socket-stream
with-open-connection
Example
Open a socket connection to the GBBopen Project web server:
> (open-connection "GBBopen.org" 80) #<socket stream connected from localhost/51756 to gbbopen.org/80> >
Note
Connections should always be closed using
The GBBopen Project
![]() | ![]() | ![]() | open-connection | ![]() |