Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Socket Programing...

How to Socket Programing...

Scheduled Pinned Locked Moved C#
databasesql-serversysadminxmltutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    h_wing
    wrote on last edited by
    #1

    Client --- Unix.. Server --- windows 2000 how does recognize what a data type client send to server? ................................................................. How to Know server dataType this is Receive Data from Client ??? .................................................................. client send Data server receive data .. how to konw dataType if DataType is picture or avi file than save to the other file name and same file type if DataType is sting than order to SQL Server... "select~~from~where" + string if DataType is XML file than save to XML file Please answer me.. i m Socket Programing at first

    J H 2 Replies Last reply
    0
    • H h_wing

      Client --- Unix.. Server --- windows 2000 how does recognize what a data type client send to server? ................................................................. How to Know server dataType this is Receive Data from Client ??? .................................................................. client send Data server receive data .. how to konw dataType if DataType is picture or avi file than save to the other file name and same file type if DataType is sting than order to SQL Server... "select~~from~where" + string if DataType is XML file than save to XML file Please answer me.. i m Socket Programing at first

      J Offline
      J Offline
      Jinwah
      wrote on last edited by
      #2

      Before sending the data send a datatype maybe as a enumerated type, integer or string. Maybe create a struct that has a datatype field? Just some ideas... HTH Luke

      1 Reply Last reply
      0
      • H h_wing

        Client --- Unix.. Server --- windows 2000 how does recognize what a data type client send to server? ................................................................. How to Know server dataType this is Receive Data from Client ??? .................................................................. client send Data server receive data .. how to konw dataType if DataType is picture or avi file than save to the other file name and same file type if DataType is sting than order to SQL Server... "select~~from~where" + string if DataType is XML file than save to XML file Please answer me.. i m Socket Programing at first

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        You should search CodeProject. There is lots of examples and topics regarding socket programming. How do you know the data types? You're the one sending and receiving them, so you dictate what those structures are. If you didn't create these structures for either the client or the server, then you need to consult the documentation for the socket client or server that you're trying to talk to. As far as sending files, you just send them using a buffer (a Byte[] array) as is. For strings and XML, just send the character data using the proper encoding (see System.Text.Encoding for more information). You get the Byte[] array for the characters based on an agreed encoding between client and server. You can either assume a single encoding between the two, or send data (much like HTTP, SMTP/MIME, etc.) using an encoding that one dictates.

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups