Results 1 to 6 of 6

Thread: Socket chat is not receiving on java server...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Socket chat is not receiving on java server...

    Hello guys,

    I am making a java chat server, and a guy was able to connect to it no problem (however, he logged off for the night before I ran into any problems, so I couldn't see what he did).


    Anywho,

    Here is my code on the VB form:

    Code:
            Debug.Print("Conected to Chat Server ...")
            clientSocket.Connect("localhost", 4444)
    
            serverStream = clientSocket.GetStream
    
                Dim outStream As Byte() = System.Text.Encoding.ASCII.GetBytes(TextBox1.Text + ".")
                serverStream.Write(outStream, 0, outStream.Length)
                Debug.Print("Wrote: " & TextBox1.Text)
                serverStream.Flush()

    now, debug says it's writing this...

    but on the server side, i don't see ANYTHING coming through...at all.


    any help would be fantastic. thanks!

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Socket chat is not receiving on java server...

    I suppose i should add,

    in the java code,

    Code:
    				// Get input from the client
    				DataInputStream in = new DataInputStream (mySocket.getInputStream());
    				PrintStream out = new PrintStream(mySocket.getOutputStream());
                                    
    				while((line = in.readLine()) != null && !line.equals(".")) {
    					input=input + line;
    					out.println("I got:" + line);
                                            log.log(Level.INFO, "[BukkitCS]: {0}", line);
    				}

    it does show up as connection, on both ends... just, i can't seem to send any info through.

  3. #3

    Re: Socket chat is not receiving on java server...

    Are...are you writing a plugin of sorts for Bukkit?

    EDIT: Yeah, offtopic >.>

    Ontopic: So the connection works, but no data is pushed through? Try using the clientSocket.Send() method or BeginSend()

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Socket chat is not receiving on java server...

    Yes, a plugin for bukkit, lol.

    and i'll try that.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Socket chat is not receiving on java server...

    and that worked (clientSocket.Client.Send)

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Socket chat is not receiving on java server...

    I also established, it was a bytes issue.

    my other 'serverstream.write' now works as well.

Posting Permissions

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



Click Here to Expand Forum to Full Width