socket is appending recieved messages

im working on a chat client,
the client socket seems to be appending recieved messages together
this is causing problems

ie.
server.senddata "clear"
server.senddata "user someone"
server.senddata "user me"

client gets
clear
user someoneuser me

can anyone please eplxain why its doing this?

Comments

  • : im working on a chat client,
    : the client socket seems to be appending recieved messages together
    : this is causing problems
    :
    : ie.
    : server.senddata "clear"
    : server.senddata "user someone"
    : server.senddata "user me"
    :
    : client gets
    : clear
    : user someoneuser me
    :
    : can anyone please eplxain why its doing this?
    :

    I beleive this is a side affect of the way TCP works. TCP will gather all data out going into the same packet over a certain period of time as long as it doesn't excede the packet size. You could add a vbcrlf to
    to every send so it would display properly.
  • : : im working on a chat client,
    : : the client socket seems to be appending recieved messages together
    : : this is causing problems
    : :
    : : ie.
    : : server.senddata "clear"
    : : server.senddata "user someone"
    : : server.senddata "user me"
    : :
    : : client gets
    : : clear
    : : user someoneuser me
    : :
    : : can anyone please eplxain why its doing this?
    : :
    :
    : I beleive this is a side affect of the way TCP works. TCP will gather all data out going into the same packet over a certain period of time as long as it doesn't excede the packet size. You could add a vbcrlf to
    : to every send so it would display properly.
    :


    thats what i was thinking, i solved the problem by just sending the userlist all in one,

    one thing i forgot to mention before, the "user" messages where in a loop

    so its more like
    socket.senddata "clear"
    for x = 0 to usercount
    socket.senddata "user " & username(x)
    next x

    and yes i tried adding a doevents after sending (didnt help much, in most cases)
  • : socket.senddata "clear"
    : for x = 0 to usercount
    : socket.senddata "user " & username(x)
    : next x
    :
    : and yes i tried adding a doevents after sending (didnt help much, in most cases)

    DoEvents doesn't even make sense in this context.

    It's common to use a CRLF sequence to indicate the end of a line or command over an internet protocol. It gives the receiving end of a socket a clear demarcation between pieces of information.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories