Creating and Sending Packets over TCP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writing a network system for project I am working on. How would I send a
class or structure to the clients and recieve one back.

Or how would I go about building a packet with a header and other
information and then be able to break it apart when I recieve it at the other
end. These packets can be of Varible length but would always have the same
header. I want to build someting simular to the DirectPlay System of packets
and networking.
 
I have done some reading and found that I think I need to serialize the
object. I am now looking for examples on doing this with an Object.

I need to serialize the object, then send it down the TCP Connection (Bytes)
and then rebuild it later. What streams and Methods do I use. Examples would
be great.
 
I suggest you research .NET remoting and web services. Search around Google or MSDN and you'll find a ton of topics.

There is a remoting thread you can post questions on. That would be a more appropriate place then a C# thread.

Remoting will allow you to serialize and deserialize objects and pass them through registered channels via TCP or HTTP connections.
You have your choice of serializers for SOAP XML or Binary depending on the context of your application and it's data. The web
services framework is integrated into the VS.NET IDE so it's easy to create web services (for sending objects and data over the
internet) with a few clicks.

Good Luck.
 
I do not think Remoting is what I need as I need to have a connection to the
server to transfer data back and forth, Async Sockets, (I am Converting the
old Textbased MUD enviroment to Tile based GUI system) as DirectPlay is no
longer being worked on I need to Create my own solution.


Dave said:
I suggest you research .NET remoting and web services. Search around
Google or MSDN and you'll find a ton of topics.

There is a remoting thread you can post questions on. That would be a
more appropriate place then a C# thread.

Remoting will allow you to serialize and deserialize objects and pass them
through registered channels via TCP or HTTP connections.
You have your choice of serializers for SOAP XML or Binary depending on
the context of your application and it's data. The web
services framework is integrated into the VS.NET IDE so it's easy to
create web services (for sending objects and data over the
internet) with a few clicks.

Good Luck.

--
Dave Sexton
(e-mail address removed) (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
Glenn Wilson said:
I have done some reading and found that I think I need to serialize the
object. I am now looking for examples on doing this with an Object.

I need to serialize the object, then send it down the TCP Connection
(Bytes)
and then rebuild it later. What streams and Methods do I use. Examples
would
be great.
 
Serialization is a mathod to "pack" an object in a binary form.
When you deserialize the object you have a copy of the serializated object.

If you want to use objects to communicate between server and clients,
serialization will be very handy.

Glenn Wilson said:
I do not think Remoting is what I need as I need to have a connection to the
server to transfer data back and forth, Async Sockets, (I am Converting the
old Textbased MUD enviroment to Tile based GUI system) as DirectPlay is no
longer being worked on I need to Create my own solution.


Dave said:
I suggest you research .NET remoting and web services. Search around
Google or MSDN and you'll find a ton of topics.

There is a remoting thread you can post questions on. That would be a
more appropriate place then a C# thread.

Remoting will allow you to serialize and deserialize objects and pass them
through registered channels via TCP or HTTP connections.
You have your choice of serializers for SOAP XML or Binary depending on
the context of your application and it's data. The web
services framework is integrated into the VS.NET IDE so it's easy to
create web services (for sending objects and data over the
internet) with a few clicks.

Good Luck.

--
Dave Sexton
(e-mail address removed) (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
Glenn Wilson said:
I have done some reading and found that I think I need to serialize the
object. I am now looking for examples on doing this with an Object.

I need to serialize the object, then send it down the TCP Connection
(Bytes)
and then rebuild it later. What streams and Methods do I use. Examples
would
be great.

:

I am writing a network system for project I am working on. How would I
send a
class or structure to the clients and recieve one back.

Or how would I go about building a packet with a header and other
information and then be able to break it apart when I recieve it at the
other
end. These packets can be of Varible length but would always have the
same
header. I want to build someting simular to the DirectPlay System of
packets
and networking.
 
(I am Converting the old Textbased MUD enviroment to Tile based GUI system

Well I'm not sure about the "MUD" or "Tile" environments that you are refering to.
as DirectPlay is no
longer being worked on I need to Create my own solution.

If DirectPlay is what you need then I suggest using DirectX 9.0 SDK. It provides a .NET wrapper around the new DirectX library and
integrates the help system into VS.NET.

As far as I know DirectPlay is still "being worked on". I'm not sure what you are refering to. If you need help with DirectX there
is a DirectX thread you can post to.
I need to serialize the object, then send it down the TCP Connection
(Bytes)
and then rebuild it later

FYI, remoting is an abstraction from Sockets. If you need sockets then the remoting framework just provides a way for you to
serialize and deserialze objects without the hassel of low level socket coding.

All in all, the C# thread is not an appropriate place for your inquiry. You will most likely not find the answers you are looking
for by posting to this thread.

Hope this helps.

--
Dave Sexton
(e-mail address removed) (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
Glenn Wilson said:
I do not think Remoting is what I need as I need to have a connection to the
server to transfer data back and forth, Async Sockets, (I am Converting the
old Textbased MUD enviroment to Tile based GUI system) as DirectPlay is no
longer being worked on I need to Create my own solution.


Dave said:
I suggest you research .NET remoting and web services. Search around
Google or MSDN and you'll find a ton of topics.

There is a remoting thread you can post questions on. That would be a
more appropriate place then a C# thread.

Remoting will allow you to serialize and deserialize objects and pass them
through registered channels via TCP or HTTP connections.
You have your choice of serializers for SOAP XML or Binary depending on
the context of your application and it's data. The web
services framework is integrated into the VS.NET IDE so it's easy to
create web services (for sending objects and data over the
internet) with a few clicks.

Good Luck.

--
Dave Sexton
(e-mail address removed) (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
Glenn Wilson said:
I have done some reading and found that I think I need to serialize the
object. I am now looking for examples on doing this with an Object.

I need to serialize the object, then send it down the TCP Connection
(Bytes)
and then rebuild it later. What streams and Methods do I use. Examples
would
be great.

:

I am writing a network system for project I am working on. How would I
send a
class or structure to the clients and recieve one back.

Or how would I go about building a packet with a header and other
information and then be able to break it apart when I recieve it at the
other
end. These packets can be of Varible length but would always have the
same
header. I want to build someting simular to the DirectPlay System of
packets
and networking.
 
Back
Top