Results 1 to 10 of 15

Thread: Sockets unit in Lazarus

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Well, realize that these examples are real good for demonstrating the basics of socket / network programming. However, turning them into something practical will be a long road indeed.

    The first thing you need to do is understand what is going on and why. What the various socket functions are doing, what the contents of the data structures are, and what order you need to use to do any particular thing.

    Complex client/server network apps are also often multi-threaded, which throws a-whole-nother dimension of complexity into the mix, but we can get into that later.

    So, let's start with getting you real familiar with what is going on with the examples, then we can step up to more complex functionality when you're ready. Study the examples, and read a bit through the (windows or linux) socket documentation; you can find both on the internet with a simple google search on Winsock (the MSDN documentation is best) or unix sockets. Bookmark these resources, because you will be referencing them often in development.
    Last edited by Murmandamus; 05-03-2011 at 06:45 PM. Reason: typo

  2. #2
    Okay, study time =)

  3. #3
    Alright it all seems to make sense now, at least I think it does =) only line that I can't understand is:

    ServerAddr.sin_addr.s_addr := htonl($7F000001);

    I think it has something to do with setting the socket address to localhost.

    I looked up what Winsock, IPv4, and TCP/IP actually mean, that was a learning experience =P now I know a little more about the way networking works. Next step? No idea. Am I excited to find out? Heck yes
    Last edited by NickS; 07-03-2011 at 11:57 AM. Reason: Side note: I want the server and client to be programmed in Windows.

  4. #4
    21 days later I feel like I've been abandoned. Have no fear, I will take the knowledge of the previous posters and adventure out into the mysterious world of network programming. Wish me luck! If you have any advice or great places to find info for noobs like me, post them here.

    Thank you.

  5. #5
    I am using synapse library for sockets myself but haven't done anything bigger with it yet. 1 problem is with my network connection which doesn't let me act as server to outside world. Smaller problem was access violation last time (half year ago or more) i tried it on Ubuntu linux, worked fine on Windows.

  6. #6
    I imagine in your case it is a port issue. Make sure any ports you are using are open. You will need to configure your router if the ports are closed.

Tags for this Thread

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
  •