Results 1 to 5 of 5
  1. #1
    mrhid6 is offline Member
    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    0

    Exclamation java server client socket sending and reading data HELP!

    Hello there i need help im making a mmorpg and i want to use sockets to send data to and from the client to my server so for example:

    username is sent from client to server

    server validates username then sends x and y location data

    i was thinking of using POST or GET type things like you do on html or PHP but have no idea how to do this on java also i am new to java sockets and if any one has some code on how to do the sending of data through sockets can u please post :)

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default Re: java server client socket sending and reading data HELP!

    )) Just read about sockets protocols and http protocol. You will understand what you want to do. ) Because now you just don't understand what sockets is and http is. ))
    Regard.
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    mrhid6 is offline Member
    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    0

    Default Re: java server client socket sending and reading data HELP!

    ok so i have made some code for the socket data will be sent like this "cmd=login,user=uname,pass=pwd" i know how to split the "," in the string but i am trying to split the "=" using this code:

    String[] msg = clientCommand.split(",");

    String temp_cmd1 = msg[0];
    String[] temp_cmd2 = temp_cmd1.split("=");
    String cmd = temp_cmd2[0];

  4. #4
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default Re: java server client socket sending and reading data HELP!

    You must do some code, which we can run. Can you tell what is clientCommand and what value does it have?
    Skype: petrarsentev
    http://TrackStudio.com

  5. #5
    mrhid6 is offline Member
    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    0

    Default Re: java server client socket sending and reading data HELP!

    clientCommand is just a string which looks like this "cmd=login,user=username,pass=password"

Similar Threads

  1. Java Socket server with C client problem
    By rnvrnv in forum Networking
    Replies: 6
    Last Post: 11-09-2010, 01:47 AM
  2. Simple Socket program: Java Client- C server
    By pimmling in forum New To Java
    Replies: 1
    Last Post: 11-08-2010, 02:27 PM
  3. Replies: 3
    Last Post: 04-05-2010, 03:19 AM
  4. Replies: 0
    Last Post: 04-05-2009, 04:59 PM
  5. Replies: 1
    Last Post: 02-10-2009, 10:16 AM

Tags for this Thread

Posting Permissions

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