dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- The dawn of a new IRC era"]
cratuki has quit [sterling.freenode.net irc.freenode.net]
youknow365 has quit [sterling.freenode.net irc.freenode.net]
piggybox has quit [sterling.freenode.net irc.freenode.net]
Amorphous has quit [sterling.freenode.net irc.freenode.net]
youknow365 has joined #ocaml
cratuki has joined #ocaml
Amorphous has joined #ocaml
piggybox has joined #ocaml
shekmalhen has joined #ocaml
shekmalhen has left #ocaml []
khaladan has joined #ocaml
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
bohanlon has quit [""Ackermann!""]
Smerdyakov has quit ["Leaving"]
<flux__> conditional?
araujo has quit ["out!"]
<youknow365> flux__: yes ?
<flux__> what do you mean by that?
<flux__> do you need to use if-expression with select?
<flux__> not necessarily, you could simply have all your sockets non-blocking and you could try operating on all of them after select returns
<flux__> but I'd say it is more efficient to scan the actual results
<youknow365> i ned the select to keep chekcing 24 7
<youknow365> flux__: ^^
<youknow365> i would accomplish this by a loop correct ?
<flux__> yes
<youknow365> flux__: so how would i accomplish this ......have a select check a socket 24 7 but still keeping my other aspects of the program alive user gui actions etc etc ?
<flux__> are you using gtk?
<youknow365> Yep
<flux__> gtk provides its own select loop
<flux__> (glib, actually)
<flux__> you can just register stuff with it
<youknow365> o yea some guy was telling me about that
<flux__> alternatively you could run your select loop in a separate thread
<youknow365> i forgot about it
<flux__> but concurrent programming has its problems
<youknow365> flux__: the whole point of using the select is so i dont have another threa
<youknow365> d
<youknow365> concurrent ?
<flux__> parallel, threaded
<youknow365> so whats a better way ?
<youknow365> having glib do it for me ?
<flux__> yes
<youknow365> how does that work though ?
<youknow365> why doesnt it hang the program ?
<flux__> I don't remember if I've used glib's mechanism (atleast from Ocaml), but I believe it works like that you register your file descriptors with glib
<flux__> so whenever a socket is able to return you data it will call your function
<flux__> or likewise, when the socket is writable
<flux__> so then you do your little piece of work and return from the function
<youknow365> its an im client i need the select to check for new messages and or check to see if i can send messages
<flux__> in a networked application you might read data and add it to your incoming buffer and check if the buffer is ok to be handled
<youknow365> i think thats an overkill for this
<youknow365> just an jabber im client
<youknow365> it should do all memory stuff automatically
<TSC> Is there a way to tell the compiler that a certain function really should be made inline?
<flux__> I don't think so
<flux__> I take it you've tried giving ocamlopt the -inline -switch?
<TSC> Yeah
<TSC> That didn't seem to make much difference
<TSC> Oh, hang on
<TSC> Aha
<TSC> It helps if you don't mark the function as "rec"
<TSC> (:
<youknow365> flux__: do you know the name of that Gnome thing again ?
<flux__> gnome thing?
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
<youknow365> im sorry
<youknow365> Glib
<youknow365> flux__: ^^
pango_ has quit [Remote closed the connection]
pango__ has joined #ocaml
EsotericMoniker has quit [Read error: 104 (Connection reset by peer)]
EsotericMoniker has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
postalchris has joined #ocaml
EsotericMoniker has quit [Read error: 104 (Connection reset by peer)]
EsotericMoniker has joined #ocaml
pango__ has quit [Remote closed the connection]
dan2 has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
EsotericMoniker has quit [Read error: 104 (Connection reset by peer)]
pango has joined #ocaml
slipstream has joined #ocaml
<dan2> I've always been impressed with ocaml
<dan2> maintain clarity and brevity throughout your code with very powerful features
Wild_Cat has joined #ocaml
smimou has joined #ocaml
Snark has joined #ocaml
love-pingoo has joined #ocaml
maml has quit [Read error: 113 (No route to host)]
maml has joined #ocaml
piggybox has quit [Connection timed out]
piggybox has joined #ocaml
love-pingoo has quit [Read error: 113 (No route to host)]
Snark has quit [Read error: 104 (Connection reset by peer)]
ulfdoz is now known as ingeB0RG
Snark has joined #ocaml
kral has joined #ocaml
Oatmeat|cs has joined #ocaml
Oatmeat|umn has quit [Connection timed out]
love-pingoo has joined #ocaml
dan2 has quit [Remote closed the connection]
slipstream has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has quit ["Leaving"]
slipstream has joined #ocaml
kral has quit ["ERC Version 5.1.2 (IRC client for Emacs)"]
cratuki has left #ocaml []
cratuki has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
mwc has joined #ocaml
slipstream has joined #ocaml
finelemo1 has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
finelemo2 has joined #ocaml
Wild_Cat has quit ["Leaving"]
finelemon has quit [Read error: 113 (No route to host)]
finelemo1 has quit [Read error: 110 (Connection timed out)]
mwc has quit [Read error: 113 (No route to host)]
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
flux__ has quit [Remote closed the connection]
flux__ has joined #ocaml
flux__ has quit [Remote closed the connection]
mwc has joined #ocaml
mwc has quit [Client Quit]
mwc has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
flux__ has joined #ocaml
postalchris has quit ["Trillian (http://www.ceruleanstudios.com"]
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
Snark has quit ["Leaving"]
mwc has quit ["Leaving"]
mwc has joined #ocaml
youknow365 has quit [Read error: 104 (Connection reset by peer)]
mwc has quit [Read error: 113 (No route to host)]
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
other_adam has joined #ocaml
love-pingoo has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
youknow365 has joined #ocaml
<youknow365> anyone up?
<Smerdyakov> Yes.
love-pingoo has quit [Read error: 110 (Connection timed out)]
Grincheux has joined #ocaml
<Grincheux> lo zmdkrbou
<zmdkrbou> lo
<youknow365> good good ........ok trying to put this select into my Program now
<youknow365> i will prolly have an error here in a few
<other_adam> how do I get just the IP portion of a Unix.sockaddr?
<youknow365> is it possible to make your own widgets with GTK ?
<youknow365> so the select will look at the file descriptors to see if anything is there write ?
<Grincheux> "write" ?
<youknow365> to read
<Grincheux> yes
<youknow365> could you give me an example how the select is to be setup ?
<youknow365> val select : file_descr list ->
<youknow365> file_descr list ->
<youknow365> file_descr list ->
<youknow365> float -> file_descr list * file_descr list * file_descr list
<youknow365> thats all it gives me
<Grincheux> i gave you an example url 3 days ago
<Smerdyakov> Read the C manual page.
<youknow365> Grincheux: i must have missed it
<Smerdyakov> That is, read the man page for the C select() function.
<youknow365> Smerdyakov: the C manual page wasn't all to helpful either :(
<Smerdyakov> Then you have a problem.
<youknow365> hmmmmm
<youknow365> well let me see something
<Grincheux> no you didn't miss it
<youknow365> Grincheux: well if you could be kind enough to send it again that would be great :P
<Grincheux> look for "Here is the improved program:"
<youknow365> Grincheux: so do i have ot also make the sockets non blocking ?
<Grincheux> no
<youknow365> whats non blocking then ?
<youknow365> and what is this eqeue ........thats not select if i remmeber is it ?
<Grincheux> non-blocking means that read won't block if there is nothing. it's somehow similar to do select, except that select works without multiple file descriptor at once
<youknow365> do i need ot do that buffer stuff ??
<Grincheux> i don't know
<youknow365> hmmmmm
<youknow365> i thoguth all i was going to do was this
<youknow365> make a little Select() inside of it have it check my file descriptor for my socket and check to see if anything is there or if i can write to it
<youknow365> then have the Glib library loop it at all times
<youknow365> sounds pretty simple
khaladan_ has joined #ocaml
dark_light has joined #ocaml
<pango_> what you receive from a tcp socket is an unformatted stream of bytes (or chars, if you prefer); potentially arbitrarily broken up in packets
<pango_> so you must handle more cases than "there's nothing" or "my message has arrived"
<pango_> there's also "the first 131 bytes of a message have been received"
khaladan- has joined #ocaml
<pango_> etc.
other_adam has quit [Read error: 110 (Connection timed out)]
khaladan has quit [Success]
khaladan- is now known as khaladan
khaladan_ has quit [Read error: 110 (Connection timed out)]
khaladan_ has joined #ocaml
mpc has joined #ocaml
<youknow365> messages get split up in packets ?
khaladan has quit [Read error: 110 (Connection timed out)]
<youknow365> i mean i will jus take the input from the socket and parse it then display
khaladan_ is now known as khaladan
<youknow365> pango_: ^^
<Grincheux> if you send 1MB of text, you really expect it to traverse the internet as a single packet without problem?
<Grincheux> everything is fragmented
bzzbzz has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
tennin has joined #ocaml
smimou has quit ["bli"]
<youknow365> Grincheux: whats your solution ?
<Grincheux> solution to what ?
carrumba has joined #ocaml