Results 1 to 2 of 2

Thread: Socket Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Socket Help

    Hello my name is Luccas and i'm new here, Well I make a pong game and i'm planning to put the game online to me and my friend play. and in the future and with a little time of job create a more complex thing like rooms and something like that.
    Anyone can help me this is my code i'm using:
    Code:
    Movimentation:
    If isup in Form1.DXInput1.States then
    Form1.ClientSocket1.Socket.SendText('up');
    Server
    If ServerSocket1.Socket.ReceiveText = 'up' then
    ServerSocket1.Socket.Connections[0].SendText('upok');
    Client
    If ClientSocket1.Socket.ReceiveText = 'upok' then
    Sprt.Y:= Sprt.Y+10;
    I'm Having problem in this code i dont Know what is going wrong someone could help me

  2. #2

    Re: Socket Help

    Your logic in the code seems ok, but you leave some questions open:
    1) What network component are you using? DelphiX network component is very outdated.

    2) "ServerSocket1.Socket.ReceiveText"
    - Is this a function or a saved variable after receiving data?
    - When are you using this (is it somesort of onData event)? Is this the correct way to use this by possible example projects?
    - Do you use it more than once? If so, are you sure the ReveiveText remains the same. Maybe it is meant to be read to a variable first.
    - Is the connection ok in both ways?

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
  •