georgepatotk Posted June 26, 2004 Posted June 26, 2004 Dear all, I am a big doubt which I had thought for few weeks.. Hope that u could help me in solving this problem. I am writing a server client application where as usual server is to listen to the request from client. For each connection with the server, the client are able to receive data based on the request command from the client. For example: 1. Client send "GETNAME" server response and send to client a list of user name in ListBox format 2. client send "GETAGE George" server will response and send to the client the age of George in numeric format 3. Client send "GETALLDETAIL" server will response and send a list of data in datagrid format In different situation, server will response and send different type of data to client, in what way could I write a program in such manner? Please help me. And in addition, can I send an ICollection thru the network? If can, how is it going to be done? Quote George C.K. Low
MikeHildner Posted June 29, 2004 Posted June 29, 2004 I don't see any reason why you couldn't do that. If you haven't gotten into sockets, I'd read through MSDN topics "Using a Synchronous Server Socket", "Using a Synchronous Client Socket" and the asynchronous counterparts "Using an Asynchronous Server Socket" and "Using an Asynchronous Client Socket". Mike Quote
pelikan Posted July 2, 2004 Posted July 2, 2004 why reinvent the wheel? look into .NET Remoting MarshalByRef objects passing serializable objects by value - you get a wide range of configuration options. Binary, Soap, Http, TCP even custom protocols and formatting layers. Quote IN PARVUM MULTUM
georgepatotk Posted July 3, 2004 Author Posted July 3, 2004 Yea, as I could find out, there is a class called serializable in .Net. Very usefull tool in sending things over network. Thanks for your resposes. Quote George C.K. Low
georgepatotk Posted July 7, 2004 Author Posted July 7, 2004 I have a new doubt in this topic. I am sending networkstream with the format shown below to the server. Can anyone tell me how to combine these two objects into one byte array in the client and how to break them in te server? FORMAT: command(0-511) & serialized dataset(512 - dataset size+512) Please help me, i need this urgently. Quote George C.K. Low
Administrators PlausiblyDamp Posted July 7, 2004 Administrators Posted July 7, 2004 You could combine them into a single class that is marked Serializable and then send that class over the network. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
georgepatotk Posted July 7, 2004 Author Posted July 7, 2004 Damn ****ing good idea. Thanks a lot.... the concept is nice. Quote George C.K. Low
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.