Thread: Re: [Dev-C++] serialization question
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-10-18 19:39:21
|
Ok handler acts like a translator? a simple handshake would work. E.g. <Connection Established to client that accepts binary data> Handler: Hello Client: Hello, I accept binary data. Handler: Very well I will send binary data. <Continue connection using binary> <Connection Established to client that does not ccepts binary data> Handler: Hello Client: Hello Handler: <Assume the client does not accept binary>. <Continue connection using ASCII> Using this method the client tells the server whether it is capable of accepting binary or not. The handler then sets up accordingly. What are you capable of changing/updating? the clients, the handler or the server? I do have another method but it requires changing the clients and the handler. Signed David McKen ----- Original Message ----- From: Nehal Shah To: dev...@li... Sent: Friday, October 17, 2003 4:56 PM Subject: [Dev-C++] serialization question Hi All I have a question regarding serialization out. So here is the current working. Client<---->handler<----->Server in the current scenario whenever handler learns something from Server it first (because it is in network order) decodes the data then serializes it out and then spit it the client and and eventually client understands the ASCII format. In the new approach we are thinking of, not decoing anything at handler level but just sending binary data to the client and on the client side they will decode and store into the database. now what I do not understand is, if my handler sends binary format to the Client on the same connection on which sometimes client does accept the ASCII data how is the client going to diffrenciate between those two and what can I do to make it working in either case. Any suggestion/comments on this will be appreciate on this. thanks --------------------------------- Do you Yahoo!? The New Yahoo! Shopping - with improved product search |
|
From: Nehal S. <ns...@ix...> - 2003-10-19 21:50:08
|
Hi Dave- So yeah handler is like a proxy between server and the client. There is some mapping done on the handler side. I have access of client side as well so I was thinking something like, server will binary data to the handler and handler will convert it in such a way that some part of the data will be in ascii and some will be in bin. On the client side I will do bare minimum process (which is must) in ascii and rest will just use it in binary. So I guess that should work. What do you think? you can send both data over one connection w/o any problem so long as other side understand. nehal -----Original Message----- From: David McKen [mailto:ci...@ya...] Sent: Saturday, October 18, 2003 12:38 PM To: Dev-Cpp Mailing List Subject: Re: [Dev-C++] serialization question Ok handler acts like a translator? a simple handshake would work. E.g. <Connection Established to client that accepts binary data> Handler: Hello Client: Hello, I accept binary data. Handler: Very well I will send binary data. <Continue connection using binary> <Connection Established to client that does not ccepts binary data> Handler: Hello Client: Hello Handler: <Assume the client does not accept binary>. <Continue connection using ASCII> Using this method the client tells the server whether it is capable of accepting binary or not. The handler then sets up accordingly. What are you capable of changing/updating? the clients, the handler or the server? I do have another method but it requires changing the clients and the handler. Signed David McKen ----- Original Message ----- From: Nehal Shah <mailto:ns...@ix...> To: dev...@li... <mailto:dev...@li...> Sent: Friday, October 17, 2003 4:56 PM Subject: [Dev-C++] serialization question Hi All I have a question regarding serialization out. So here is the current working. Client<---->handler<----->Server in the current scenario whenever handler learns something from Server it first (because it is in network order) decodes the data then serializes it out and then spit it the client and and eventually client understands the ASCII format. In the new approach we are thinking of, not decoing anything at handler level but just sending binary data to the client and on the client side they will decode and store into the database. now what I do not understand is, if my handler sends binary format to the Client on the same connection on which sometimes client does accept the ASCII data how is the client going to diffrenciate between those two and what can I do to make it working in either case. Any suggestion/comments on this will be appreciate on this. thanks _____ Do you Yahoo!? The <http://shopping.yahoo.com/?__yltc=s%3A150000443%2Cd%3A22708228%2Cslk%3Atext %2Csec%3Amail> New Yahoo! Shopping - with improved product search |
|
From: David M. <ci...@ya...> - 2003-10-20 15:54:02
|
Another way would be to do something like html <binary>Binary data</binary> <ascii>Ascii data</ascii> Of course your markers don't have to be so big but you get the idea. Better yet you don't even have to have a close marker. When a marker comes through you just assume all data that follows is of the specified until it finds another marker. e.g. <binary>Binary data.................. <ascii>Ascii data.................... I can guess you want to keep the number of connections down but is binary data going to be kinda like files? In which case you can do something similar to the ftp protocol. When a file (binary data) need to be sent it opens up a seperate socket and uses that to transfer the file. Only one type of data is sent on such a connection and once the file has been transfered then the connection is closed. This has the problem of excessive network connections if there are alot of small files to transfer. The other problem with this method is unless you want to worry about multiple connections you can only transfer one file at a time. Hope this Helps David McKen --- Nehal Shah <ns...@ix...> wrote: > Hi Dave- > > So yeah handler is like a proxy between server and the client. > There is some > mapping done on the handler side. > I have access of client side as well so I was thinking something > like, > server will binary data to the handler and handler will convert it > in such a > way that > some part of the data will be in ascii and some will be in bin. On > the > client side I will do bare minimum process (which is must) in ascii > and rest > will just use it in binary. So I guess that should work. > > What do you think? you can send both data over one connection w/o > any > problem so long as other side understand. > > nehal > > > -----Original Message----- > From: David McKen [mailto:ci...@ya...] > Sent: Saturday, October 18, 2003 12:38 PM > To: Dev-Cpp Mailing List > Subject: Re: [Dev-C++] serialization question > > > Ok handler acts like a translator? > > a simple handshake would work. > > E.g. > <Connection Established to client that accepts binary data> > Handler: Hello > Client: Hello, I accept binary data. > Handler: Very well I will send binary data. > <Continue connection using binary> > > > <Connection Established to client that does not ccepts binary data> > Handler: Hello > Client: Hello > Handler: <Assume the client does not accept binary>. > <Continue connection using ASCII> > > Using this method the client tells the server whether it is capable > of > accepting binary or not. The handler then sets up accordingly. > > What are you capable of changing/updating? the clients, the handler > or the > server? I do have another method but it requires changing the > clients and > the handler. > > Signed > David McKen > > > ----- Original Message ----- > From: Nehal Shah <mailto:ns...@ix...> > To: dev...@li... > <mailto:dev...@li...> > Sent: Friday, October 17, 2003 4:56 PM > Subject: [Dev-C++] serialization question > > > Hi All > > > I have a question regarding serialization out. So here is the > current > working. > > Client<---->handler<----->Server > > in the current scenario whenever handler learns something from > Server it > first (because it is in network order) decodes the data then > serializes it > out and then spit it the client and and eventually client > understands the > ASCII format. > > > In the new approach we are thinking of, not decoing anything at > handler > level but just sending binary data to the client and on the client > side they > will decode and store into the database. > > now what I do not understand is, if my handler sends binary format > to the > Client on the same connection on which sometimes client does accept > the > ASCII data how is the client going to diffrenciate between those > two and > what can I do to make it working in either case. > > > Any suggestion/comments on this will be appreciate on this. > thanks > > > > _____ > > Do you Yahoo!? > The > <http://shopping.yahoo.com/?__yltc=s%3A150000443%2Cd%3A22708228%2Cslk%3Atext > %2Csec%3Amail> New Yahoo! Shopping - with improved product search > > __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com |