Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: What lib is suitable for.

  1. #1

    What lib is suitable for.

    What lib is suitable for 2 clients communicate with no server involved
    From brazil (:

    Pascal pownz!

  2. #2

  3. #3

    What lib is suitable for.

    Thanks for the quick reply, i should use tcp or udp ?
    From brazil (:

    Pascal pownz!

  4. #4

    What lib is suitable for.

    UDP is faster, but packets can be lost. The call is yours. With UDP you kind of need a server I think. Someone else might know more.

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    What lib is suitable for.

    Like Robert said UDP is faster than TCP. However with TCP you don't have to worry about losing packets as all the code to manage this is inside the TCP protocol.

    For UDP you'd have to manage all that stuff yourself. This can be a boon or a problem for your game depending on how exactly you want to send your data back and forth and what you want to send.

    The ideal balance for network functionality is to send as little data as you can, maximizing the usefulness of what you are sending, while at the same time making sure that both sides are getting all the data they need to synchronize gameplay between all game clients involved.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6

    What lib is suitable for.

    Don't worry about that but, what about servers, i can't have one :?

    wich one will be best? the clients will conect directly
    From brazil (:

    Pascal pownz!

  7. #7

    What lib is suitable for.

    I'm not sure I understand, but if you have two pc's connected to eachother you can simply have one set up as server and the other as client (or the other way around), right?

    Or, for testing purposes run one server program and one (or more) client(s) all on the same pc and let them connect to localhost.

  8. #8
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    What lib is suitable for.

    Well in networking there are 2 main categories: peer-to-peer and server-client.

    However when you are working within an application's code you have to think a little differently.

    You see if you have a single peer-to-peer between 2 clients, one will have to act as the server or master, yes. So they will usually setup 'the game' from which the other will connect to. There are lots of fancy ways to manage this, but this is the way that the TCP/UDP protocols work.

    As for which is better. I cannot say, thats up to you to try and see which you prefer. Though I am more familiar with Indy and it does have a component suite for both Delphi and Lazarus if you ever wanted to go cross-platform.

    Others that you can use include sdl_net which comes with the JEDI-SDL package. Dean Ellis wrote a few articles on how to work with it. Just take a look in the Article section for his small series.

    If you wanted , you could also use DirectPlay, but I don't think it's used or supported anymore.

    If you wanted to get all hardcore you can also just use one of the sockets units that come with either FPC or Delphi. But thats a bit low-level and you might not want to start off like that as almost everything would need to be done from scratch.

    Don't really know of any others. Just take a look at those and try the demos/examples read up and see which you feel would be better to start with. You can always switch later so long as you code your project well enough.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #9

    What lib is suitable for.

    Actually, the best place to look for these questions is here. It's a nice networking FAQ.

    If you decide to go using UDP, then you don't need a particular library, WinSock is quite easy to use. I've wrote two wrappers myself (TNetCom and TNetExchange), which both provide guaranteed packets and the second one also assures correct packet ordering.

    I'd also recommend against using Indy, as it has quite bad implementation IMHO and is not easier to use than WinSock itself.

    P.S. Two clients can communicate with each other using Client-Server mechanism (so one client is server and another is client). In this case, "two clients" is a wrong way to say it; the correct term would be "two applications".

  10. #10

    What lib is suitable for.

    Quote Originally Posted by Lifepower
    Actually, the best place to look for these questions is here. It's a nice networking FAQ.

    If you decide to go using UDP, then you don't need a particular library, WinSock is quite easy to use. I've wrote two wrappers myself (TNetCom and TNetExchange), which both provide guaranteed packets and the second one also assures correct packet ordering.

    I'd also recommend against using Indy, as it has quite bad implementation IMHO and is not easier to use than WinSock itself.

    P.S. Two clients can communicate with each other using Client-Server mechanism (so one client is server and another is client). In this case, "two clients" is a wrong way to say it; the correct term would be "two applications".
    Thx it helped a lot¬?

    now i can say that i want peer to peer and TCP

    Is there something simple to do that ?
    From brazil (:

    Pascal pownz!

Page 1 of 2 12 LastLast

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
  •