[Openmcl-devel] Playing with sockets

Stefano Bennati bennati at cognition.uni-freiburg.de
Tue Feb 12 05:18:01 PST 2013


Dear Clozure-ers,

I am trying to create a simple function that queries a server and 
returns the answer.
I am using the socket functions integrated in Clozure to do so.
Until now I succeeded in sending the request to the server with the 
following code

>     (ccl:with-open-socket (socket :address-family :internet :type
>     :stream :connect :active
>
>         :remote-host MY-HOST :remote-port MY-PORT) (format socket
>         MY-STRING))
>
But now I have no idea how to read the answer (string) that the server 
gives in response to MY-STRING.
The only function that I have found, receive-from, operates only with 
passive sockets and I cannot find the way to convert my socket into a 
passive one.
There must be a simpler way that I am missing.
Thanks for your help!
Cheers

Stefano

-- 
M.Sc. Stefano Bennati
Centre for Cognitive Science
Friedrichstr. 50
D-79098 Freiburg, Germany

Phone: +49 761 203-4947
Fax:   +49 761 203-4938
email: bennati at cognition.uni-freiburg.de
web:   http://portal.uni.freiburg.de/cognition/members-de/bennati/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20130212/af4c0162/attachment.htm>


More information about the Openmcl-devel mailing list