|
-
Aug 17th, 2011, 02:42 AM
#1
Thread Starter
Fanatic Member
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!
-
Aug 17th, 2011, 08:21 PM
#2
Thread Starter
Fanatic Member
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.
-
Aug 17th, 2011, 08:35 PM
#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()
-
Aug 17th, 2011, 09:07 PM
#4
Thread Starter
Fanatic Member
Re: Socket chat is not receiving on java server...
Yes, a plugin for bukkit, lol.
and i'll try that.
-
Aug 17th, 2011, 09:13 PM
#5
Thread Starter
Fanatic Member
Re: Socket chat is not receiving on java server...
and that worked (clientSocket.Client.Send)
-
Aug 18th, 2011, 05:23 PM
#6
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|