473,396 Members | 1,734 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,396 software developers and data experts.

Send structures through the network

Hi
I want to know is there any way to send structures instance to another
computer through the network with sockets?
When Send() method only accept byte[], How can I send them to the network?

Thanks in advance
Nov 16 '05 #1
2 1358
Hi
You can simply do that using .net remoting . you would also many exmples if
you search the web for remothing .

Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC
Nov 16 '05 #2
clu
As Mohammoss pointed out, if you stay inside a .NET environment (on
both sides of your communications) it is much easier and feature-rich
to use a .NET communication technology like .NET Remoting (which is not
the only possible solution, I'm just thinking about WS ...).

BTW, Remoting is a customizable infrastructure where you can choose the
transport protocol you wish to use (HTTP and TCP are provided but you
can implement your own channels). Sockets may be used under the hood
(they almost always are, since the TCP channel relies on socket
communication, as well as the HTTP channel does, although this is often
hidden by the server host).

You can surely use "raw" sockets.
What you need is, though, to define a protocol on which both the client
and the server do agree.

Defining a protocol is just about defining what raw data streams (the
byte[] you send) represent from a logical perspective.

So the client should translate its high-level data into a byte array
(serialization) which is sent over the wire; your server will use the
same translation mechanism to deserialize the input stream into a copy
of the original high-level data.

You might, for example, leverage the .NET serialization features in
order to serialize an object and later deserialize it.
It's impossible to give you a complete overview neither about .NET
serialization, or about .NET Remoting or inter-process communication in
general.

I would suggest you to take a look at the MSDN web site
(msdn.microsoft.com), which has lots of valuable contents and samples.

HTH

Claudio Brotto

Nov 16 '05 #3

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

Similar topics

1
by: becker | last post by:
Hi, how are you? I have been reading networking related source code written in C lately, and I have encountered so many structures that I have no clue of. Could anybody tell me how to get somewhat...
1
by: Amadej | last post by:
Hello everyone, I'm having some odd problems with a little program I wrote for sending/receiving bytes across the network. I am using synchronous sockets, and it seems that when I send byte...
4
by: Zahid | last post by:
Hi, I have a number of structures that I want to send using UDP protocol. How do I convert the structure into bytes/array of bytes? Using UDP protocol is a MUST - a Client Requirement. Am I...
20
by: newbie | last post by:
Hi all, http://www.aswin.be/nictransfer.JPG How can I get these numbers with VB.NET ? I thought somewhere in WMI but I can't find them. Thank you, Aswin
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
8
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
2
by: =?Utf-8?B?Y2hpZWtv?= | last post by:
Hello, I have Asp.net 2.0 app that needs to send an email. It works fine when the app tries to send inside of the network, but I can’t send email outside. Does anyone know how I can resolve...
1
by: peary | last post by:
Hi, everyone, I'm writing a program to discover wireless network using Windows Native Wifi API & VB.net. I have to declare the windows API in my VB.net program. The original windows...
0
by: thesti | last post by:
hi, need some help on network programming. i'm new to network programming. i need to make a program that sends a signal/message to every other hosts in the same network that also run the same...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.