473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating and Sending Packets over TCP

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.
Nov 16 '05 #1
5 4556
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.

"Glenn Wilson" wrote:
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.

Nov 16 '05 #2
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
ds*************@somethingdigitalBYE-SPAM.com (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
"Glenn Wilson" <Gl*********@discussions.microsoft.com> wrote in message news:3C**********************************@microsof t.com...
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.

"Glenn Wilson" wrote:
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.

Nov 16 '05 #3
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" <NO*********@dotcomdatasolutions.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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
ds*************@somethingdigitalBYE-SPAM.com (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
"Glenn Wilson" <Gl*********@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
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.

"Glenn Wilson" wrote:
> 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.


Nov 16 '05 #4
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" <ir****@hotmail.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP15.phx.gbl...
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" <NO*********@dotcomdatasolutions.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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
ds*************@somethingdigitalBYE-SPAM.com (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
"Glenn Wilson" <Gl*********@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
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.

"Glenn Wilson" wrote:

> 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.



Nov 16 '05 #5
> (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
ds*************@somethingdigitalBYE-SPAM.com (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
"Glenn Wilson" <ir****@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... 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" <NO*********@dotcomdatasolutions.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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
ds*************@somethingdigitalBYE-SPAM.com (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
"Glenn Wilson" <Gl*********@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
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.

"Glenn Wilson" wrote:

> 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.



Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yawnmoth | last post by:
so... i'm trying to send some FTP packets, via PHP, and... i'm not really sure how to construct 'em. HTTP 1.0 packets have the following structure: GET http://whatever.com/ HTTP/1.0 Accept:...
1
by: coder_1024 | last post by:
I'm trying to send a packet of binary data to a UDP server. If I send a text string, it works fine. If I attempt to send binary data, it sends a UDP packet with 0 bytes of data (just the...
0
by: Andreas Pauley | last post by:
Hi, I'd like to generate my own icmp packets from within python. Typically this would include sending an ECHO_REQUEST and checking if I get an ECHO_REPLY back. But I would also like to...
2
by: Alessandro | last post by:
Hi everyone! I'm a newcomer in C#, I'm trying to send battery-life status values via UDP packets to a remote machine. I get these values, now i've to put them in UDP messages and send... could...
7
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. ...
9
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
6
by: White Spirit | last post by:
I can send data over a raw socket in C#. The part that is currently a problem is constructing the packet to be sent. To construct the packet, is it necessary to construct the packet 'by hand' and...
0
by: kardon33 | last post by:
Ok in my attempt to create a program to communicate with an ArtNet Node witch talks through UDP packets. I was stream packets and i accidentally set the loop for an infinite amount. I can not stop...
2
by: =?Utf-8?B?R3JlZ0lJ?= | last post by:
Hi All, I have some problems with sending UDP packets using Winsock. I tried to send some to a closed port, and according to the documentation on Microsoft MSDN site...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.