From: Siddhesh P. <sid...@gm...> - 2010-05-26 04:42:40
|
2010/5/25 devil online <min...@gm...> > > you should go through the documentation > > http://libyahoo2.sourceforge.net/README That is a good start. You will however need a reference implementation since the documentation has not been updated after the YMSG16 change. You might want to go through the code in Ayttm to figure out how it has been implemented: http://ayttm.git.sourceforge.net/git/gitweb.cgi?p=ayttm/ayttm;a=summary That said, we need someone to volunteer to update the documentation to reflect the YMSG16 changes, I just don't have the time to do that right now. > 6. File Transfer > > To send a file, call yahoo_send_file(id, who, msg, name, size). > > > This will set up the initial file send connection and return a unix file > descriptor that you must write to. You then write the file's contents to > this fd. > > Receiving a file is similar. You will receive a call to ext_yahoo_got_file > > with the file's url as one of the parameters. When you are ready to start > downloading the file, make a call to yahoo_get_url_handle: > > fd = yahoo_get_url_handle(id, url, &fname, &fsize); > > fname and fsize are used to store the file's name and size > > > Yahoo's file transfer is implemented using HTTP. It can either be peer > to peer or via the yahoo file transfer servers. The latter is used in > case a peer to peer connection cannot be set up - for example, in the > > case of a firewall. > > libyahoo2 supports both types of file transfer for receiving, but only > sends files using the yahoo file transfer server. > > If anyone's interested in implementing peer to peer file send, this is > > how it happens. > > First a PEERTOPEER packet is sent to check if it is possible. This will > mark the connection between these two hosts as p2p compatible. No further > PEERTOPEER packets will be sent between these two hosts for the duration > > that the connection is alive. > > After the first P2P packet, the initiater will start an HTTP server on > some port (really any port), and send the url across to the other end. > > After this, the first host will always play the part of the server for > > all file transfers. If a transfer is from the server, it uses GET, if > it is from the client to the server, it uses POST. There is no encoding > used for POST. > > You'll still have to study it a bit, but IMO the major complexity is in > > putting a http server in the lib, and whether we want to do that. > > > 2010/5/25 淼 张 <zha...@ya...> >> >> How to transport file via libyahoo2? >> Thank you! >> >> ------------------------------------------------------------------------------ >> >> >> _______________________________________________ >> Libyahoo2-users mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libyahoo2-users >> > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Libyahoo2-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libyahoo2-users > -- Siddhesh Poyarekar http://siddhesh.in |