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/
mpc has joined #ocaml
jcreigh has joined #ocaml
jcreigh has quit [Client Quit]
finelemon has quit [Read error: 110 (Connection timed out)]
finelemon has joined #ocaml
shekmalhen has joined #ocaml
mpc has quit []
smimou has quit [Read error: 110 (Connection timed out)]
<youknow365> this is confusing the crap outta me
mpc has joined #ocaml
jcreigh has joined #ocaml
jcreigh has quit [Client Quit]
Carillon has joined #ocaml
mpc has quit []
Carillon_ has quit [Connection timed out]
Carillon is now known as Carillon_
<youknow365> i wish this channel was more active
<shekmalhen> heh
<youknow365> hmmmm
<youknow365> shekmalhen: you familiarwith networking programming
<shekmalhen> not much. I'm not a network guy. I have a lot to learn
<youknow365> well i got a small tcp client that jus sends something on a certain port .......works fine
<youknow365> but i need ot also recive packets coming in on that same port i am connected to and that is the problem
<youknow365> shekmalhen: any ideas
<shekmalhen> code?
<youknow365> all it does now is send that to that port
<youknow365> and print back how amny bytes it has sent
<youknow365> but i also need to have it recieve messages also
<youknow365> i guess revc will do that
pango_ has joined #ocaml
<shekmalhen> I see... same code as yesterday
<youknow365> not quite
<youknow365> code yesterday didnt work
<youknow365> ;)
<youknow365> this works plus i have condensed it down a little
<youknow365> shekmalhen: any ideas
<shekmalhen> one sec
<youknow365> kk
<youknow365> this is the only thing thats stumping me
<shekmalhen> what error do you get?
<youknow365> no error im jus not clear how ot do it
<youknow365> shekmalhen: you dont know ocaml to well either eh :P
<shekmalhen> this, and I'm doing other stuff simultaneously, and looking at the Unix module :)
<shekmalhen> but the socket stuff is... pretty much the same, as I would have thought
pango has quit [Remote closed the connection]
shining has quit ["leaving"]
<youknow365> shekmalhen: i need to recive stuff on that same connected socket
pattern has quit [calvino.freenode.net irc.freenode.net]
piggybox has quit [calvino.freenode.net irc.freenode.net]
buggs has quit [calvino.freenode.net irc.freenode.net]
Amorphous has quit [calvino.freenode.net irc.freenode.net]
buggs has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
pattern has joined #ocaml
piggybox has joined #ocaml
<shekmalhen> youknow365, you did some C, right?
<shekmalhen> you did some socket programming in it?
Amorphous has joined #ocaml
<youknow365> not socket stuff in C no
<youknow365> C yes jus never did any socket or networking stuff
<shekmalhen> 'k
<shekmalhen> because it really works the same way
<shekmalhen> Your socket is a unix file descriptor
<shekmalhen> you can write and read to it
<youknow365> yes i need to read from it
<youknow365> but how can i do it in the same process
<shekmalhen> just did a few tests with nc
<youknow365> netcat?
<shekmalhen> yes
<youknow365> same here
<youknow365> but i cant get the read [part down
<youknow365> i need to read for any info that comes through and print it
<youknow365> and keep reading
<youknow365> and at the same time allow mw to send data on that port
<youknow365> shekmalhen: ^^
<shekmalhen> first, you'll need threads or subprocesses
<shekmalhen> because you can't accept connections and send data at the same time, in the same process / thread
<youknow365> shekmalhen: accpet connections whjy would i do that
<youknow365> i am oging to be connected
<youknow365> going
<youknow365> i am going to connect to the jabber server
<youknow365> i can send ims
<youknow365> now i jus need to recive ims
<shekmalhen> you need a socket that listen to connections and one that connects
<shekmalhen> 'k
<youknow365> you dont open a new socket and port connection for every IM
<youknow365> that would be crazy
<shekmalhen> no
<shekmalhen> that's not what I understood.
<youknow365> what?
<youknow365> i need to send and recive ims on a connected port
<youknow365> :P
<youknow365> i got the connecting and sending part dwon
<youknow365> now i jus need a way to recive on the same port
<youknow365> sock etc
<shekmalhen> well.. it simple then
<shekmalhen> read and write
<youknow365> please show me :P
<youknow365> how can i read
<shekmalhen> they're your friend
<youknow365> how can i read
<shekmalhen> 'k... one sec
<youknow365> recv
<youknow365> can i do this in one proicess ?
<youknow365> shekmalhen: sock_recv client_sock 1024 ;
<youknow365> that can read
<youknow365> but it jus waits for data
<youknow365> i need to recive and send at the same time
<youknow365> grrrrrrrrrrr
<shekmalhen> echo test | nc -l -p 4550; echo
<youknow365> i dont get what you have done here
<youknow365> it jsut waits for input right ?
<shekmalhen> first, it reads the content of the socket
<shekmalhen> then it write back what it read
<shekmalhen> so it should just parrot the stdin to netcat
<shekmalhen> up to 255 chars
<shekmalhen> :)
<youknow365> then it closes right
<shekmalhen> yup
<youknow365> thats not what im saying ........what i am tyring to do is an im client i dont know when any kind of im comes in
<shekmalhen> threads or subprocesses
<shekmalhen> :)
<youknow365> i dontthink thats needed
<youknow365> threads are for more pwoerful stuff
<shekmalhen> Unix.select might help
<youknow365> what does unix select do ?
<shekmalhen> poll the file descriptors to see if there is any activities
<shekmalhen> but yet, it won't solve your problem
<youknow365> how often does it poll ?
<shekmalhen> it matters?
<shekmalhen> :)
<shekmalhen> continuously
<youknow365> i mean i dont want my messages to be delayed
<shekmalhen> it won't... really.
<shekmalhen> give it a try
<shekmalhen> but... select is good at working with several fd.
<shekmalhen> if you have only one, it won't be useful
<youknow365> lol
<youknow365> dude all i need is to read and write to a socket at the same time without the use of a thread
<youknow365> threads are for more intense things
<youknow365> file sharing etc
<shekmalhen> :)
<youknow365> now i jus need ot accomplish this
<shekmalhen> heh
<youknow365> any other ideas :P
<shekmalhen> choose a more humble project to start
<youknow365> this is a needabe
<youknow365> and once i get this little part out of the ay it should be alllll good
Revision17 has joined #ocaml
youknow365 has quit ["Konversation terminated!"]
shekmalhen has quit ["dodo"]
jcreigh has joined #ocaml
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
edwardk has joined #ocaml
edwardk has left #ocaml []
dark_light has joined #ocaml
tlavoie has joined #ocaml
tlavoie has quit ["BitchX: its what's for lunch"]
descender has joined #ocaml
_jol_ has joined #ocaml
falconair has joined #ocaml
finelemo1 has joined #ocaml
finelemon has quit [Read error: 60 (Operation timed out)]
<araujo> # int_of_string "hello" ;;
<araujo> Exception: Failure "int_of_string".
<araujo> #
<araujo> what is happening there?
<araujo> ah get it
shining has joined #ocaml
smimou has joined #ocaml
basti_ has joined #ocaml
_jol_ has quit [Read error: 110 (Connection timed out)]
shining has quit ["leaving"]
shining has joined #ocaml
slipstream has quit [Read error: 54 (Connection reset by peer)]
slipstream has joined #ocaml
slipstream has quit [Read error: 54 (Connection reset by peer)]
slipstream has joined #ocaml
_jol_ has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
gn has joined #ocaml
_jol_ has quit ["leaving"]
Carillon has joined #ocaml
Carillon_ has quit [Read error: 110 (Connection timed out)]
Carillon is now known as Carillon_
Schmurtz has joined #ocaml
mpc has joined #ocaml
mpc has quit []
shekmalhen has joined #ocaml
Hadaka has quit [calvino.freenode.net irc.freenode.net]
Naked has joined #ocaml
Naked is now known as Hadaka
mpc has joined #ocaml
mpc has quit []
Schmurtz has quit ["L'énergie semble manquer : dodo !"]
mpc has joined #ocaml
_jol_ has joined #ocaml
Wild_Cat has joined #ocaml
_jol_ has quit ["temci lo nu citka"]
finelemon has joined #ocaml
_jol_ has joined #ocaml
finelemo1 has quit [Read error: 110 (Connection timed out)]
gn has quit []
youknow365 has joined #ocaml
<youknow365> yo
<youknow365> anyone up
_jol_ has quit ["co'o rodo"]
<pango_> youknow365: hello
shekmalhen has quit ["bê6h"]
mnemonic has joined #ocaml
<youknow365> pango_: you still there ?
<pango_> yes
Kai1111 has left #ocaml []
<basti_> hi youknow
d-bug has quit ["This computer has gone to sleep"]
<youknow365> hi
<youknow365> sweet im getting 2 mbps connection speed
<youknow365> pretty good for wireless
<youknow365> my house one gets 8 though
shekmalhen has joined #ocaml
finelemon has quit [Read error: 104 (Connection reset by peer)]
<youknow365> basti_: im still trying to resolve my tcp problems
<basti_> :|
finelemon has joined #ocaml
<pango_> I saw a post of someone looking for old jabber lib on ocaml mailing list...
<youknow365> it was me
<youknow365> pango_: ;)
<mnemonic> re
<pango_> did you receive my email ?
<youknow365> but its 4.5 years old.......all i need is roster stuff and im .......Plus its way outdated
<youknow365> whats ur email ?
<youknow365> or first 4 letters
<pango_> I sent you the archive of the website on Internet Archive, and some place where to find a copy of the tar.gzs...
<pango_> and yes, it's old stuff by now :/
smimou has quit [Read error: 110 (Connection timed out)]
<youknow365> petchema ??
<pango_> yes
<youknow365> yea
<youknow365> you got my hopes up :P
<youknow365> but yet i found out that it not standard anymore
<youknow365> needs updating .......but like i said once i get this tcp stuff sorted........i am familiar with SimpleXML a very small xml parser .........so my tcp stuff + simplexml will be fine
<youknow365> and LablGTK of course
<pango_> I did not check whether that lib only taken care of parsing, or also of network...
<youknow365> how can you play songs with ocaml any bindings to any libs for that kind of stuff ?
smimou has joined #ocaml
<pango_> no idea... what kind of song anyway, wav, mp3, mid,... ?
<youknow365> sound effects
<youknow365> any
<youknow365> an incoming im sound
<youknow365> thats it
<pango_> find place to look is ocaml humps...
<youknow365> i did
<youknow365> i saw a few things lib vorbis
<youknow365> and SDL sound
<pango_> yeah, sdl
<youknow365> which will work buut it adds like 500 kb
<youknow365> which i guess is fine
<youknow365> i got an application on here that uses sdl sound
<youknow365> and no the other sdl stuff
<youknow365> so yea i guess i can just use the sound part
<youknow365> i could prlly cut stuff out of it
<youknow365> just have a wav file i could cut out all the crap for wav and all those other 500 formats
<youknow365> pango_: man o man i still cant even figure out how to do this recive messages on the port i am connected to
<youknow365> its not like i cant do it ......i jus dont know what you have to do
<youknow365> i dont want 2 threads and everyone is telling me i only need 1
Demitar has quit ["Ex-Chat"]
clog has joined #ocaml
<youknow365> dark_light: your the first person that has gave me that kind of info
<youknow365> what will be the fastest ?
<youknow365> and most simple to code and maintain
<dark_light> youknow365, in terms of code? i have no idea :( most conservatives unix apps would use select because it is a very old technique.. but on muti-processor machines, forks would be very faster..
<youknow365> lol
<youknow365> its an im client
<youknow365> ;)
<youknow365> also will it work on windows ?
<dark_light> youknow365, the simpler is select.. because with fork you have to make a way to do communication between your forked servers.. and with threads, you will have big problems with shared data
<youknow365> and what do other most im client's use ?
<dark_light> youknow365, will work at least with cygwin :) but i think that threads will work with native windows code
<youknow365> any objections to using cygwin ?
<dark_light> and, i don't know.. :( look at gaim's code or email the guys :)
<dark_light> youknow365, no, cygwin is nice (at least for me)
<youknow365> i mean it doesnt slow anything down does it .........or add massive size ?
<dark_light> youknow365, i think you can ask people at #gaim .. and maybe #kopete
<youknow365> well with all 3 ways ....... i wouldnt be able to tell no difference would I ? this is just simple im' ing
<dark_light> youknow365, i think that actually gaim is ported to windows with cygwin (i am not sure). and i don't think it adds a great slow down to the app.. but it will make it bigger
<youknow365> how much bigger?
<youknow365> kb's or mb 's
<dark_light> don't know, maybe mb
<youknow365> hmmm
<dark_light> youknow365, there are no fork at windows
<youknow365> i already got to include a static version of gtk 2 mb
<dark_light> so cygwin will not use fork when porting your app, if you code it using fork
<youknow365> there is one way to do forking in windows
<dark_light> well, sorry then :)
<dark_light> youknow365, how?
<youknow365> googles fopr link
<dark_light> youknow365, there are a page at inria that says the level of compatibility of ocaml for windows
<youknow365> welll
<youknow365> what do you recomend
<youknow365> i habe no problem using a little cygin for the select
<dark_light> select works with ocaml for windows
<youknow365> select or threads
<youknow365> oooo
<dark_light> youknow365, i recommend select.. it's simpler
<youknow365> so i should use select
<youknow365> welllll could you show me a small example how select works i have never saw it .......
<dark_light> youknow365, i will begin my server (many tries after..) with select, but it's a poor design just for begin. then i will try to port it for threads.....
<dark_light> youknow365, well..
<youknow365> this is just a small im clinet someone might have 5 ims open at once max
<youknow365> this is not a server app that will have thousands of connections at once
mnemonic has quit ["leaving"]
<dark_light> youknow365, a infinite loop with a select in the begin, and the select receives three params.. the sockets that are about to be read, the sockets that are about to be writed, and the sockets that are about to be checked for exceptional conditions.. and when it returns, it returns all sockets that have something to read, all sockets that you can do write now.. and you do the operations..
<dark_light> youknow365, but i have no code here:)
<youknow365> holy crap you jus kinda confused me :(
<dark_light> youknow365, well, you can search for C examples
<youknow365> so there wil be a loop running at all times?
<dark_light> yes
<youknow365> do alot of apps do this
<youknow365> will this kill my cpu ?
<dark_light> after (or before) doing all things related to sockets, you might want to read what the user typed, and do all related stuffs, and then execute select again..
<dark_light> youknow365, no
<youknow365> i mean like overload it
<pango_> you'll have to handle GUI events too... I wonder if equeue wouldn't help, instead of plain Unix.select...
<youknow365> how is this different ?
* dark_light has never seen equeue before
<dark_light> (s/has/had/, maybe.. the english grammar is actually very complex for me)
<youknow365> so whats better this or select
<youknow365> dark_light: native language
<pango_> youknow365: equeue uses select
<pango_> youknow365: just providing a more abstract framework for event driven programming
<dark_light> youknow365, my native language? portuguese:)
<youknow365> i seee.......so whats the point of it
<youknow365> dark_light: where do you live
<dark_light> natal, brazil
<dark_light> and you?
<youknow365> lmao
<pango_> youknow365: I think the introduction is well written ;)
<youknow365> i lived there also
<youknow365> then moved to Rio
<youknow365> then back to the US
<dark_light> here in natal?!? lol :P
<youknow365> natal is safest in brasil :P
<youknow365> and i remember the beaches to be nice also
<dark_light> youknow365, natal is very hot, and i love the cold :P and i have beaches :)
<youknow365> you like cold lol
<youknow365> wtf
<dark_light> hate*
<youknow365> ooooooo
<youknow365> lol
<youknow365> natal is good i liked Rio as well
<dark_light> yes, natal isn't that bad..
<youknow365> i might get a place in brasil .......
<youknow365> when i am rich :P
<youknow365> i live in Miami now
<youknow365> (which is also considered latin america ;) )
<dark_light> do you speak portuguese?
<youknow365> i did
<youknow365> just spanish and english
<youknow365> soo Nao :P
<youknow365> tu hablas espanol ?
<dark_light> yo no hablo, pero.. .. usually i understand it :P
<youknow365> english/spanish/porturgese .....all the same thing :P
<youknow365> english is the only language to relate to spanish ......except porturgese ..........englis hhas more in common with spanish then italian does
<dark_light> they have some differences :P the rules are generally a bad thing for me:(
<youknow365> rules?
<dark_light> yes, like the.. had/have/has.. and that kind of stuff..
<dark_light> i never know if i am writing the "right" english
<dark_light> and too i never know if i am writing the "right" spanish
<youknow365> spanish has the same thing
<youknow365> tengo/tiene etc
<youknow365> porturgese i htink has some asian in fluence
<dark_light> asian? lol.. portuguese has certainly some tupi influence.. and from another tribes.. and the native people of here migrated from asia.. well, it may be ..
<dark_light> (at least the brazillian portuguese)
<youknow365> yes brazlillian porturgese
<youknow365> Nao
<youknow365> etc
<youknow365> slangs likea taiwanese
<youknow365> like a *
<youknow365> lao
<youknow365> hi in cantonese
<dark_light> lao = hi, in the language of taiwan?
<youknow365> no
<youknow365> cantonese
<dark_light> don't know cantonese:)
<youknow365> me either
<youknow365> hada few friends from there
<youknow365> had a *
<youknow365> atleast when brazillians learn english itdoenst sound foreign
<youknow365> cause theirs lower tons and stuff
<youknow365> tones
<youknow365> Spanish from Mexico sound like they just jusmped the border
<dark_light> i meant, i don't know where cantonese is speaked
jcreigh has joined #ocaml
<youknow365> hong kong
<dark_light> ah
<youknow365> you ever been to US
<dark_light> no
<youknow365> ah
<youknow365> us is more like brasil
<youknow365> we eat feijoada and stuff
<dark_light> sure?:)
<youknow365> yes
<youknow365> down south'
<youknow365> not north
<dark_light> hmm, yes
<youknow365> peoplein north is more italian stuff
<youknow365> pastas
<youknow365> all that stuff
<youknow365> down south is more like rice beans that kind of stuff
<youknow365> JAMBYLYAAA
<shining> /j #chat
<dark_light> shining, low traffic on #ocaml is actually a good thing?
<shining> it isn't, but total offtopic is even worse
<dark_light> hmmm.. yes
<youknow365> lol
<youknow365> shining: if the channel had 500 people and you were the number 1 moderator ......you *might* be in the position to say something is off topic
<youknow365> but anyways back to my problem