Passing Objects Over A Network

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > C# .NET

Passing Objects Over A Network

vizskywalker
So, I am working on an extended media server application for personal use, and I'm currently using TcpListener and TcpClient objects to establish a network connection. This works fine, except that it would be really useful to be able to pass objects back and forth between the two application (server and client). If I have to switch the type of connection I am using, that's fine, but I was wondering if anyone knew of any way to pass objects back and forth. One thought I had was somehow getting a byte[] buffer of all of the object's data, send that, and then translate it back into an object, but I have no idea a) if that's possible and cool.gif how to do that. Any ideas are helpful.

Thanks,
~Viz

Reply

faulty.lee
I haven't really tried this, but I've read about it quite a lot of times, and have look into it, just haven't got a chance to apply yet, tongue.gif

Here's what you need. ISerializable interface. You use Serialize the object that you want to send, using BinaryFormatter, calling the Serialize method, and pass in a stream and the object that you want to convert to byte stream. You object must implement ISerializable. I believe most .Net's component are serializable. For you own defined class, you'll need to implement manually. Check the MSDN for ISerializable. http://msdn2.microsoft.com/en-us/library/s...objectdata.aspx

The other technology that you can look into is SOAP. It's http friendly. Take a look here. http://www.codeproject.com/soap/XMLFormatter.asp
It's more like the JSON (JavaScript Object Notation), which if I'm not wrong, it allow passing object from client side javascript to server side PHP.

Depending on our need. If you don't need to be http compatible, the simply Serialize your object and send through your tcp connection, which less the overhead and compatibility of SOAP

Well, good luck.

PS:Keep me posted on the outcome. Thanks

 

 

 


Reply

vizskywalker
Can all objects be serialized in this manner? Such as, is there a way to take a non-serializeable object and somehow make it aerializeable byt putting it in a wrapper class? I ask because one of the objects I am looking to pass is the PlayList object that is part of the iTunes SDK COM.

~Viz

Reply

faulty.lee
QUOTE(vizskywalker @ Oct 8 2007, 06:18 AM) *
Can all objects be serialized in this manner? Such as, is there a way to take a non-serializeable object and somehow make it aerializeable byt putting it in a wrapper class? I ask because one of the objects I am looking to pass is the PlayList object that is part of the iTunes SDK COM.

~Viz


I'm not that sure. From the MSDN example, you need to implement the 2 methods under ISerializable. You'll have to manually add each member value into the SerializationInfo. If the PlayList object is one of your struc or class, then it's possible, if not, it might or might not be, need to search for more info on that.

Btw, on top of my first post, make sure that both side of the program has the same version of assembly, or at least the object is still the same order as before. If not, anything can happen.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. c# iserializable and encryption - 320.76 hr back. (1)
Similar Topics

Keywords : passing, objects, network

  1. Optimum Network Solution
    (2)
  2. Getting My Wireless Network Adapter Working On Linux
    (2)
    Well, I recently decided to switch over all my PC's to linux, and was stumped when I tried to
    convert one of my laptops. It has a Dell Wireless 1370 wireless networking mini-pci card, based on a
    broadcom chip. I tried to find a driver on the internet, to no avail. I found NDISWrapper, but
    despite my knowledge of how to set up a web server on linux, I couldn't work out how to use it.
    I found a graphic tool, but it was commercial, which ruined any use for me. I was wondering if
    anyone here knew a free tool that would automatically set it up. A few other things: m....
  3. Tracing Broadcast Storms
    A poorly managed or configured layer 2 switch may affect network laten (1)
    In some cases, a single layer 2 switching device configured improperly can cause serious
    connectivity problems, especially on a large network. Problems of this nature behave similar to
    Denial of Service (DoS) attacks but are slightly easier to track. Most intranets serve a central
    location where other internal networks are connected. Whether it is a remote off-site location or
    only accessible by taking an underground railway, it's usually the best place to start
    disconnecting backbones to find out which physical subnet is causing the problem. Broadcast storms
    are ge....
  4. School / Uni Network And Internet Restriction
    (11)
    If anybody needs any help with restrictions on their network, or if your internet browsing is
    restricted, please post what restriction you need to bypass here, (with as much detail as possible
    please) and I will try and help you as best I can. Alternatively, you can send me an email:
    sande63@eq.edu.au (this is my school email, because at the moment the method I am using to bypass
    web restrictions can't show some java, but i'm working on it), or send me a message via this
    site. I will reply to you as soon as I can, and I hope I can help.....
  5. Network Outage. Distribution Switch Ddosed.
    Lesson Learnt (5)
    The Distribution Switch to which our network is connected was DDOSed causing a partial network
    failure. The entire downtime was reduced due to our DNS shift in Dec 2007. We regret to inform that
    today at about 11 AM IST, We started experiencing a network lag. By 12.30 PM IST, the network was
    down partially with most of our servers affected except Zeta and Mu. By 1.00 PM IST, the entire
    network had gone down and was recovered slowly by 2.00 PM IST. By 2:30 IST, the network was
    completely recovered and all servers were operating smoothly. FULL STORY: http://www.x....
  6. Bonding Network Interfaces For Double Speed?
    How to? Win 2k3 (0)
    Hello. I have server 2003 os installed on my server. I have 2 NICs connected to same switch and need
    to double speed on 2 IP. How to do it? I used linux and it was easy there, simly set up bonding. But
    how to do it in 2k3 os? Thank for help, guys. /biggrin.gif" style="vertical-align:middle"
    emoid=":D" border="0" alt="biggrin.gif" />....
  7. Are You Compliant With The Network Etiquette ?
    defining the network ethics (3)
    Hi, Are you compliant with the network ethiqhette ? (Sorry, the network etiquette or the network
    ethics). Did you know that there is a very serious document explaining how you should behave on the
    network, what is a newbie, and so on ? Look at here : http://www.ietf.org/rfc/rfc1855.txt Yordan ....
  8. Extending A Wireless Network
    Wireless Internet (2)
    Usually, to integrate WiFi capabilities into an existing LAN involves interfacing a wireless router
    with an existing LAN and configuring it as an access point. If it is meant for free public use, then
    it may not be necessary to encrypt the transmission, otherwise it is advisable to encrypt it with at
    leas a 64-bit WEP (Wireless Encryption Protocol) key. Depending on the gain in db of the attached
    antenna, the radius of wireless coverage can vary from 250meters to close to 450meters. Now comes
    the stage where we need to extend the coverage of the wireless transmission, t....
  9. Linking Iframes
    Linking Objects to Iframes (1)
    Hello, I'm really new at web design and I know little about code; so if this is an obvious
    answer... sorry. I'm trying to have an iframe appear when an object is clicked on. All of my
    objects (links) are the same on every page and so this way the whole page wouldn't have to
    reload. I want all of my links to work like this and then dissappear when a different link (object)
    is clicked on. Here's the code I found that I'm trying to use and substitute my stuff with.
    Currently I need the www.w3.org to be replaced with an object not text. Is this possible?....
  10. Proxy And Network Drive Script
    (2)
    At school they've decided to force us to use a proxy server (a sucky one because it's more
    offline than operational). As an Opera user, it's just a matter of pushing F12 to enable or
    disable the use of a proxy server, but IE users and FF will have to do a litlle bit more. That's
    why I've made this little "script" for the other users at school (in fact it's just a .reg
    file that windows will import). Set and enable a proxy server (copy the following code into a file
    with a .reg extention) CODE Windows Registry Editor Version 5.00 [HKEY_C....
  11. Networking With A Wireless Network Adapter
    (10)
    So my question is this, I have a desktop pc connected to the net through a wired modem. I also have
    a free (as in not used) wireless network adapter build in to the desktop pc which I want to share
    with a laptop. The goal is to have a live internet connection on the laptop. What are the steps I
    need to follow to achive my goal. Thnx in advance EDIT: additional info, I have winxp installed on
    the desktop and windows vista installed on the laptop....
  12. Free Web Hosting: (network)
    Free Website: <solarflare.astahost.com> (1)
    To generate an application for free web hosting please click here: Free Web Hosting
    Request Form I would like to request free web hosting from Astahost. Please find my
    application below. Your Registered Domain Name or Desired Astahost Subdomain Name:
    solarflare.astahost.com Account Username: network Introduction: My hobbies
    include programming and scripting, going out, all video gaming there is. Email Address:
    danielcase44@yahoo.co.uk Age: 15 Country Where I Live: England My
    Websi....
  13. Advanced Network Questions
    (3)
    I am running a wireless router. I connect my computer. I plug in my lan connected to a wired router.
    wired router is connected to anther computer. How can I get the internet to work for the last
    computer? Cross-over cables don't like my computers which is why im using a router. I just
    haven't been able to figure this out. Thanx for any help. Please check your posts for spelling
    mistakes ....
  14. How To Keep The Internet Out From A Network ?
    Using Dlink Giga lan switch, DSL ... see picture (9)
    So..in the picture below you can see the schematic I made. The internet enters in the first PC thru
    the DSL box , and I wanna connect the internet PC with the other PC's with a giga lan speed. For
    that I think I will need a second Lan card because the internet PC only has one lan port. Next I use
    the Dlink 8 ports Switch. But I don't want the internet go from the internet PC thru the Dlink
    and to the other PC's. Because I don't wanna put firewall and stuff on the other PC's.
    But maybe with this setup, the internet will just naturally stop at the firs....
  15. Won't Reconnect To Wireless Network Automatically Once Disconnected
    (7)
    Just built my new computer and holding off on a new wireless PCI adapter for the time being. I have
    an old TrendNET USB Wireless Adapter that I plugged into this new computer. The problem I'm
    having now is that whenever I get disconnects from my DSL router Windows won't reconnect
    automatically /mad.gif" style="vertical-align:middle" emoid=":angry:" border="0" alt="mad.gif" />
    On my laptop (using the Netgear PC Card), it automatically reconnects once my DSL connection kicks
    back in. I've been living with this problem since my Internet Service Provider are o....
  16. Wireless Network Not Connecting
    (6)
    Hi, I have just reinstalled windows 2k on my laptop and have been trying to connect to my wireless
    network. I have managed to get the wireless adapter to connect to the computer (it has power and the
    computer recognizes it) and the software that comes with the card can see the AP. when i try to
    connect to the AP nothing happens. i am not able to connect to anything, no pings, no network, no
    internet! the wireless card is a Netgear Wg511v2 and the AP is a D-Link DI-524. Would this be a
    problem with the software on the computer? i have managed to connect to this same ....
  17. C++: Basic Classes
    classes, objects, access labels, members, inline functions (5)
    This tutorial assumes that you have a basic knowledge of C++. You know how to use built-in types,
    like ints, doubles, chars, etc. You should know some types that are part of the STL, like vector,
    etc. Those types that come in the STL are just C++; you can create your own types just like
    those! Non built-in types are referred to as classes . To create a class, you just use the
    keyword class , the name of the class, and curly brackets. CODE //A class named MyClass class
    MyClass { }; In fact, that is all we need to create variables, pointers, or references ....
  18. Baylan Network Switch Problem
    keeps burning out. (1)
    I bought a 10/100 8 port switch for my home network, the previous hub burned out after a couple
    years. I basically run it 24/7, and with filesharing going on, it's pretty much working nonstop.
    The adapter (9V, 500MA) burned out after about 6 hours of usage. I thought it could be just an
    accident, so i bought another adapter, but leaving it overnight resulted in the same thing. it's
    burned out again. The guy who sold it to me said that i'm not supposed to plug an electrical
    device that has an adapter built in, into a stabilizer or UPS. That that would make it ....
  19. Programming In Glut (lesson 4)
    Making 3D objects (7)
    Hello, in this tutorial we will be creating a 3D pyramid. We are building this tutorial from Lesson
    3, but I took out the 2D objects and placed a 3D pyramid in there instead. The 3rd axis for drawing
    can be a litle confusing, but after you get the hand of it you'll do fine. Now when you are
    setting a 3D vertex just remember that the camera is on the positive end of the z axis. So things
    that have a more positive z axis value are closer than verteces with a more negative value. Well
    let's get started We always start by including the glut library CODE #i....
  20. Programming In Glut (lesson 3)
    How to animate objects in GLUT (1)
    In this tutorial I am going to talk about how to get animation in your program. I will be working
    directly off of Lesson 2 and will now take out the notes left behind from Lesson 1, but I will leave
    the notes from Lesson 2. CODE #include<glut.h>//include our glut library First we
    are going to initialize a variable called "time" which will record how much time has passed so we
    can use it to determine how to animate the objects. Then we have our init function that initializes
    some stuff in GLUT CODE float time = 0;//(NEW) variable to recor....
  21. Suse 10.0: Can't Get On Network! Help Please!
    (11)
    On my main computer, I got SuSE 10.0 installed as a dual boot with no problems except the network.
    SuSE sees my integrated NIC card (it's on the motherboard) but I can't get online! I
    went into terminal, did a SU - and logged in and then did an ifconfig... eth0 is there but no IPv4
    address, just an IPv6 and then the loopback address. Could it be that I'm running the 32 bit
    version of it and when I went to install, it was like "Cool computer, but.... this is 32 bit and
    you're using a 64 bit processor!!!!"? Just wondering. I could prob....
  22. Smf Theme Creation Help
    CSS class/id for changing the colour of lower edge of header objects (13)
    I would require a forum in the near future for another of my project. I had tried my hand at phpBB
    and found that it had excessively high number of templage (.tpl) files, and I could not easily skin
    it. Next, I installed SMF on my local server, and am creating a new theme. I created a new theme
    out of the default theme, and started to change the colours for all elements. I have got almost all
    of what I want, except for one thing. Here is what I have in the header: I need to change that
    gray area in the bottom edge of the special header boxes. What property in ....
  23. Listening To Music Over A Home Network
    play the same music in two pc's at a time, or in the living room (16)
    Hi!!! well, my brother brought to my atention this product: Sonos:
    http://www.sonos.com/ It allows to control music in different zone of a home network. But i
    oposed to it because of it's price. so i'm trying to search for altenative solutions to this
    problem: ¿How can i listen to the same music in diferent pc stations at a same time? and the other
    problem: ¿How to stream music within my wireless network? (to listen to the music i play on my pc in
    my boombox per say) Can anyone come out with a good idea? PS: i forgot to say that the other sol....
  24. Unable To Connect My Comp. To A Wireless Network
    (5)
    This happened to me many times before and i eventually had to call my uncle over to help me fix it
    up. Miraculously, it always works everytime he comes. So the last time he came, i watched carefully
    and made sure i remembered everything he did. It was not exactly complicated, and he set up the
    network manually for each computer. All he did was set up a wireless network using the wizard and
    then set up a home or small office network using another wizard. I did it again with my new desktop
    but it didn't work. Even though i set permissions for the firewall to allow it a....
  25. How To Connect Computers In A Wi-fi Network
    Peer-to-peer connection? (10)
    My parents have been persuading me over and over again to do something about our wireless internet
    connection. No, its not that the router has any problems connecting the computers to the internet.
    My problem is that i want to connect my computers together to enable the sharing of files,
    programs, and most importantly, my printer. Unfortunately, I have no idea how to use the already set
    up wireless connection to link all the computers together. I've done networking with cables yeah
    but never with wireless. I've tried the wizards Windows XP provides to create ne....
  26. Problem: Network Connection Fails Every 2 Mins
    (12)
    From time to time, my internet connection falls out; It's been happening since i installed XP
    again. In the beginning it was 2 minutes after you started up the pc. Happily, now it's jsut
    when you download a big file or so. Does anyone know how to solve my problem?? Thanks, Michiel....
  27. Switch Network Settings With Batch Files
    A quick way to change IP, Gateway, DNS (18)
    Let's suppose you are using two network settings with your laptop frequently. Wether it's a
    wireless or wired network, all the same: Every time you want to change the IP, subnet mask, default
    gateway and DNS Server(s) of your network connection in any flavour of Windows, you have to click
    through menus, submenus, and from that you go to yet another submenu... you have been there,
    it's awful. /mad.gif' border='0' style='vertical-align:middle' alt='mad.gif' /> There is a
    better way: the command "netsh" on your command prompt can change all the aforementio....
  28. Kde Starting Problem
    Could not read network connection list (4)
    I just installed slackware 10 yesterday. and i made some changes to font config today. after i
    reboot, i fond i couldnt start kde& gnome here is the error message: Could not read network
    connection list root/.DCOPserve_hide_0 please cheak whether decopserve is running network
    connection?? My slackware has never atteched any network. It is a stand alone workstation. anyway,
    my xfce still can work . i want to know why and how to solve this thx....
  29. Dialup On Wireless Network
    cant get this dial up connection shared (18)
    I just purchased a D-Link wireless router, a DI-524. On my computer i connect through dial up to the
    internet. I have been trying to figure out how to share this connection through the router, but i
    haven't been able to because the router is made to hook up to an external modem through a WAN
    port. If there is a way to share my connection through this router, please help me with how. ....
  30. Network Places: Alternative To Ftp On Windows
    Drag and drop files easily to your accnt (10)
    Windows has a feature called "Network Places". This can be used for uploading stuff for your site
    eliminating the need for any ftp client. Here's how we do it. 1.Goto Network Places-> Add a new
    networkplace. 2. Click next-> Choose another network Location->Next. 3. Now type the following
    wothout quotes "ftp://ftp.yoursubdomain.astahost.com". Click next 4. Uncheck log on anonymously and
    type in ur cPanel username. 5. Type any name and click Next->Finish. 6. Now open the folder created
    -> Type in your password Congratulations!! You can now upload your files i....

    1. Looking for passing, objects, network

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for passing, objects, network
Similar
Optimum Network Solution
Getting My Wireless Network Adapter Working On Linux
Tracing Broadcast Storms - A poorly managed or configured layer 2 switch may affect network laten
School / Uni Network And Internet Restriction
Network Outage. Distribution Switch Ddosed. - Lesson Learnt
Bonding Network Interfaces For Double Speed? - How to? Win 2k3
Are You Compliant With The Network Etiquette ? - defining the network ethics
Extending A Wireless Network - Wireless Internet
Linking Iframes - Linking Objects to Iframes
Proxy And Network Drive Script
Networking With A Wireless Network Adapter
Free Web Hosting: (network) - Free Website: <solarflare.astahost.com>
Advanced Network Questions
How To Keep The Internet Out From A Network ? - Using Dlink Giga lan switch, DSL ... see picture
Won't Reconnect To Wireless Network Automatically Once Disconnected
Wireless Network Not Connecting
C++: Basic Classes - classes, objects, access labels, members, inline functions
Baylan Network Switch Problem - keeps burning out.
Programming In Glut (lesson 4) - Making 3D objects
Programming In Glut (lesson 3) - How to animate objects in GLUT
Suse 10.0: Can't Get On Network! Help Please!
Smf Theme Creation Help - CSS class/id for changing the colour of lower edge of header objects
Listening To Music Over A Home Network - play the same music in two pc's at a time, or in the living room
Unable To Connect My Comp. To A Wireless Network
How To Connect Computers In A Wi-fi Network - Peer-to-peer connection?
Problem: Network Connection Fails Every 2 Mins
Switch Network Settings With Batch Files - A quick way to change IP, Gateway, DNS
Kde Starting Problem - Could not read network connection list
Dialup On Wireless Network - cant get this dial up connection shared
Network Places: Alternative To Ftp On Windows - Drag and drop files easily to your accnt
advertisement




Passing Objects Over A Network



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE