Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By JosAH

Thread: how socket sends data?in android and java SE

  1. #1
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default how socket sends data?in android and java SE

    hello.

    i need to send a byte of Aaray from one device to another.i'm useing socket to do it but i don't know how sends the data?

    PHP Code:
    Socket socket=new Socket(destination,port);
    this code takes ip address and ip to connect.there is a server in listening mode. i did connect to X ip address.

    now how can i send my array list to that ip address??

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: how socket sends data?in android and java SE

    Have you read the API documentation for the Socket class? If so, you should've read that a Socket can supply an InputStream and an OutputStream, so you can read from the Socket, or write to it ...

    kind regards,

    Jos
    M0TRIX likes this.
    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: how socket sends data?in android and java SE

    Quote Originally Posted by M0TRIX View Post
    i'm useing socket to do it but i don't know how sends the data?
    I wonder more what is stopping you from researching this yourself. This is a basic "how do I do this" question, one which you can even solve with the power of the internet rather than being better off buying a book on Java socket programming (although still recommended). You are not exactly the first person doing socket programming in Java, there is a pile of information available for you to read and learn from. So why is that not happening?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 0
    Last Post: 05-11-2013, 09:10 PM
  2. Replies: 4
    Last Post: 09-29-2011, 01:17 PM
  3. Replies: 0
    Last Post: 04-12-2011, 11:11 PM
  4. How to sends data over network ?Help me!!
    By moon in forum Networking
    Replies: 2
    Last Post: 09-21-2009, 03:57 PM
  5. Replies: 0
    Last Post: 04-07-2008, 07:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •