Results 1 to 4 of 4

Thread: Sending mulitple messages using tcpClient/tcpServer

  1. #1

    Sending mulitple messages using tcpClient/tcpServer

    Hello every pascal game programmer. My problem is with the tcpClient and tcpServer components. I cant send or receive more than 1 line of message using Send() function. Fox example:
    I want the server always send to all players my current position on two line of text posx and posy. But that don¬Ąt happend. Could you help me, please
    Live programming, eat programming, breath programming and die programming

  2. #2

    Re: I need help immidietly!!

    Quote Originally Posted by yassersoft
    Hello every pascal game programmer. My problem is with the tcpClient and tcpServer components. I cant send or receive more than 1 line of message using Send() function. Fox example:
    I want the server always send to all players my current position on two line of text posx and posy. But that don¬Ąt happend. Could you help me, please
    If you are sending strings, maybe use 1 line at the time but something like this
    [pascal]send( format('%d;%d',[posx,posy]) );[/pascal]
    You will just need to parse where the ';' is and read integers next to them.

    But because games send much more kinds of msgs, you may need to send more info like type of message
    [pascal]send( format('POS;%d;%d',[posx,posy]) );[/pascal]

  3. #3

    Re: I need help immidietly!!

    If you want to send alot of data, It would be better to use a binary representation. Strings are very "user-friendly", but can make things bloated in the end. It also requires more code to parse and handle errors.

    And I would suggest you use a more descriptive topic title next time. Titles like "I need help" will not make others help you more quickly.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4

    Re: Sending mulitple messages using tcpClient/tcpServer

    Yassersoft, I have modified your thread title to something more appropriate. In the future try to use more descriptive titles which match your problem.

Bookmarks

Posting Permissions

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