• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple String Issue with my first socket-using app...  RSS feed

 
dav mccartney
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to send a quick 2 line, 1 string welcome to players when they connect. On the server side, I have:


And on the client side, I have:


However, when I connect with the client, I'm only getting:

Welcome Player 1.

With no second part of the phrase ("Please..."). Is there a simple fix for this? I'd like to understand what's going on as well

Thanks,
dav

[ September 21, 2004: Message edited by: dav mccartney ]
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is because the readLine() method does just that: it reads a line. In other words, it stops at the "\n" character. The easy fix would be to call readLine() again.

There may be another method that reads more than just a single line. You shold look at the API docs to find out.

HTH

Layne
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!