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. window Appliction using c#.net

window Appliction using c#.net

Scheduled Pinned Locked Moved C#
csharptutorial
4 Posts 2 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.
  • S Offline
    S Offline
    sivaramireddy p
    wrote on last edited by
    #1

    How To send a value in port sivaramireddy(singarayakonda,prakasam)

    A 1 Reply Last reply
    0
    • S sivaramireddy p

      How To send a value in port sivaramireddy(singarayakonda,prakasam)

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      You mean send a value to a port? Through a port? What kind of port? Port as in the drink? Port as in left? Port as in the kind of place where things go in and out of a country?

      My current favourite word is: PIE! Good ol' pie, it's been a while.

      S 1 Reply Last reply
      0
      • A Anthony Mushrow

        You mean send a value to a port? Through a port? What kind of port? Port as in the drink? Port as in left? Port as in the kind of place where things go in and out of a country?

        My current favourite word is: PIE! Good ol' pie, it's been a while.

        S Offline
        S Offline
        sivaramireddy p
        wrote on last edited by
        #3

        how to send a value in remote server using tcp port or socket programming

        A 1 Reply Last reply
        0
        • S sivaramireddy p

          how to send a value in remote server using tcp port or socket programming

          A Offline
          A Offline
          Anthony Mushrow
          wrote on last edited by
          #4

          Well, you make a connection to the other machine by use of IP and port number. For example, on the server side you could wait for a connection, and then send out some data:

          //Listen for connection
          TcpListener listener = new TcpListener(IPAddress.Any, 1234);

          //get socket from incomming connection
          Socket mySocket = listener.AcceptSocket();

          //Send the number 5
          byte[] data = {0x5};
          mySocket.Send(data);

          And the client side would make a connection, and then wait for some data:

          //Make a socket
          Socket mySocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
          //Connect to the server (assuming IP address to be 192.168.1.1)
          mySocket.Connect(IPAdress.Parse("192.168.1.1"), 1234);

          //Set up the buffer
          byte[] buffer = new byte[1024];
          //receive some data
          int dataLength = mySocket.Receive(buffer);

          //and then you can read the buffer to see what data you just received.
          //dataLength will tell you how many bytes you received, so in this case, it would be 1.

          You can of course use the mighty powers of google to find what your looking for, or type 'socket' into the search bar up there.

          My current favourite word is: PIE! Good ol' pie, it's been a while.

          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