<araujo>
i flush the out_channel if it is what you mean
<araujo>
flush oc;
<mrvn_>
consider using gethostbyname instead of inet_addr_of_string
<mrvn_>
and add a newline on the error message: Printf.printf "%s <server_address> <server_port>" Sys.argv.(0)
Demitar has joined #ocaml
<mrvn_>
araujo: you aren't sending a newline.
<mrvn_>
mrvn@frosties:~% nc -l -p 1234
<mrvn_>
foo
<mrvn_>
(no newline)
<araujo>
yeah, right
<mrvn_>
mrvn@frosties:~% ./bla 127.0.0.1 1234
<mrvn_>
foo
<mrvn_>
FOO
<araujo>
it worked?
<mrvn_>
with newline it does
<araujo>
Geez, it works now :-P
<araujo>
Thanks mrvn_
<araujo>
mmm..
<araujo>
mrvn_, so, the problem was that input_line reads until a newline?
<mrvn_>
Or until EOF. But you never close the socket on the clients end.
<araujo>
Oh, i see
<mflux_>
he wouldn't see the response in that case ;)
<mflux_>
oh wait, was it supposed to echo the response back to the socket or not? oh well
<mrvn_>
you close stdout but not stdin.
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
<mflux_>
araujo, you could simply read the input one character at a time and upcase that, or if that feels inefficient you could use the Unix.read-stuff
<mflux_>
do note that interleaving buffered and Unix.* is not a good idea
TeXitoi has joined #ocaml
<araujo>
Ok, let me see that mflux_
<araujo>
mflux_, Unix.read-stuff ?
<mflux_>
for example Unix.read, Unix.write, you will need a file descriptor for those
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
<araujo>
I see.
<araujo>
mflux_, and yes, it was supposed to echo the response back to the socket
TeXitoi has joined #ocaml
<araujo>
There is any advantage of using Unix.read,write instead?
_shawn has joined #ocaml
<mflux_>
if you're doing a threaded server then I imagine not really, but if you're writing a 'traditional' unix server with a select loop, then they are a must
Skal has quit [Remote closed the connection]
shawn_ has quit [Read error: 110 (Connection timed out)]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
beta3 is now known as dan2
karryall has joined #ocaml
cjohnson has quit [Connection timed out]
Skal has joined #ocaml
cjohnson has joined #ocaml
Gueben has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
Smerdyakov has joined #ocaml
<ulfdoz>
hrhr
<ulfdoz>
ECHAN, sorry
Smerdy has joined #ocaml
Smerdyakov has quit [Nick collision from services.]
Smerdy is now known as Smerdyakov
Smerdyakov has quit [Client Quit]
vezenchio has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
_JusSx_ has joined #ocaml
TeXitoi_ has joined #ocaml
TeXitoi_ has quit [Read error: 104 (Connection reset by peer)]
TeXitoi_ has joined #ocaml
TeXitoi has quit [Read error: 110 (Connection timed out)]
pango__ has joined #ocaml
Snark has quit [Read error: 60 (Operation timed out)]
Snark has joined #ocaml
pango_ has quit [Read error: 60 (Operation timed out)]
Smerdyakov has joined #ocaml
Gueben has quit ["plouf"]
vezenchio has quit [Read error: 110 (Connection timed out)]
pango__ has quit [clarke.freenode.net irc.freenode.net]
Hadaka has quit [clarke.freenode.net irc.freenode.net]
CLxyz has quit [clarke.freenode.net irc.freenode.net]
pango__ has joined #ocaml
Gueben has joined #ocaml
CLxyz has joined #ocaml
Naked has joined #ocaml
Naked is now known as Hadaka
Gueben has quit ["plouf"]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
<Snark>
any ocamlfind guru there?
<Snark>
I'm trying to find how to check for the presence of some packages in a configure script
<Snark>
the goal would be to fail at configure-time and not compile-time
Msandin has joined #ocaml
<mflux_>
ocamlfind list | grep '^package\b' && echo cool ?
<karryall>
Snark: ocamlfind query <package name>
<Snark>
yes, but what should I put in a configure.in
<Snark>
?
<karryall>
I use this:
<karryall>
AC_DEFUN([AC_CHECK_OCAML_PKG],
<karryall>
[dnl
<karryall>
AC_REQUIRE([AC_PROG_FINDLIB])
<karryall>
if test "$use_findlib" = yes ; then
<karryall>
AC_MSG_CHECKING(findlib package $1)
<karryall>
if $OCAMLFIND query $1 >/dev/null 2>/dev/null; then