Socket problem

georgepatotk

Well-known member
Joined
Mar 1, 2004
Messages
431
Location
Malaysia
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?
 
I dont see any reason why you couldnt do that. If you havent gotten into sockets, Id 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
 
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.
 
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.
 
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.
 

Similar threads

P
Replies
0
Views
176
Policy standard local admin account with Active Di
P
Back
Top