Commands while sending data

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

VincentLascaux
Posts: 2
Joined: 2003-08-15 10:27

Commands while sending data

Post by VincentLascaux » 2003-08-15 10:33

Hello,

I am currently coding a DC client. I dont know how to handle the messages from a client when I download something from him. The typical conversation is :

> $MyNick ...| $Lock/$Key stuff
> $Get file$1
< FileLength 6465468
> $Send
< $MaxedOut

Is "$MaxedOut" the begining of the file or an error message ?
When do I stop looking for commands from the stream and begin writing the file from the stream ?

Thanks

--
Vincent

Twink
Posts: 436
Joined: 2003-04-01 04:31
Location: New Zealand

Post by Twink » 2003-08-15 11:46

http://dcplusplus.sourceforge.net/forum ... t=maxedout

Atomic Jo wrote:Logically MaxedOut is send only when user has no free slot. But it must be send after the client handshake. You may allways receive a MyNick/Lock string, and only after that, you can receive a MaxedOut string.


so basically the other persons slots are full

VincentLascaux
Posts: 2
Joined: 2003-08-15 10:27

Post by VincentLascaux » 2003-08-15 12:03

I have probably not been clear in my first message...

I know what $MaxedOut and $Error mean. The problem is that they are sent after the send command, when my program expect to have the file.

What happens if I share a file that starts with $Error ? How can I know if the incomming data is a command or the file data ?

I send "$Send|" and wait for incomming datas. When I receive them, must I write it to the file or parse it to read an error message ?

Who is online

Users browsing this forum: Google [Bot] and 0 guests