how do you test on 1 machine?

Started by
13 comments, last by Thrump 22 years, 5 months ago
quote:Original post by Thrump
I''m doing it in Delphi. Actually, I just found a socket component for it, and it has an example of a multi-chat program. Yeah, I know it''s cheating, but there''s lots more I want to do.


Cool :-) im a delphi programmer .. so if you ever need some code checkin or anything just ask!

good luck

~ Tim
Advertisement
From what I''ve read it doesn''t sound like you are trying to do server-to-server comms. Just a standard chat server right? If that is true, read on, otherwise ignore this.

I''m not a delphi programmer either, but the process should be relatively similiar as C/C++.

1. Make the socket and set the options you want.
2. Configure the socket to the IP and port you want to use
3. Bind()(or delphi equivalent) it.
4. Listen().

Then, in your main loop you need use some method of polling that socket you just created. I use select() for C/C++. If the server socket polls as active, then you have a new person attempting to connect and you''d call an accept() (C/C++) on it. You need to store the return value somehow of course.

That''s all you really need to set up the server and listen for connections. The rest of the processing is done by polling the stored sockets...

Is this helpful?

= Fleet
From what I''ve read it doesn''t sound like you are trying to do server-to-server comms. Just a standard chat server right? If that is true, read on, otherwise ignore this.

I''m not a delphi programmer either, but the process should be relatively similiar as C/C++.

1. Make the socket and set the options you want.
2. Configure the socket to the IP and port you want to use
3. Bind()(or delphi equivalent) it.
4. Listen().

Then, in your main loop you need use some method of polling that socket you just created. I use select() for C/C++. If the server socket polls as active, then you have a new person attempting to connect and you''d call an accept() (C/C++) on it. You need to store the return value somehow of course.

That''s all you really need to set up the server and listen for connections. The rest of the processing is done by polling the stored sockets...

Is this helpful?

= Fleet
From what I''ve read it doesn''t sound like you are trying to do server-to-server comms. Just a standard chat server right? If that is true, read on, otherwise ignore this.

I''m not a delphi programmer either, but the process should be relatively similiar as C/C++.

1. Make the socket and set the options you want.
2. Configure the socket to the IP and port you want to use
3. Bind()(or delphi equivalent) it.
4. Listen().

Then, in your main loop you need use some method of polling that socket you just created. I use select() for C/C++. If the server socket polls as active, then you have a new person attempting to connect and you''d call an accept() (C/C++) on it. You need to store the return value somehow of course.

That''s all you really need to set up the server and listen for connections. The rest of the processing is done by polling the stored sockets...

If you assign the IP adx to 127.0.0.1 you can telnet to yourself.

Is this helpful?

= Fleet
From what I''ve read it doesn''t sound like you are trying to do server-to-server comms. Just a standard chat server right? If that is true, read on, otherwise ignore this.

I''m not a delphi programmer either, but the process should be relatively similiar as C/C++.

1. Make the socket and set the options you want.
2. Configure the socket to the IP and port you want to use
3. Bind()(or delphi equivalent) it.
4. Listen().

Then, in your main loop you need use some method of polling that socket you just created. I use select() for C/C++. If the server socket polls as active, then you have a new person attempting to connect and you''d call an accept() (C/C++) on it. You need to store the return value somehow of course.

That''s all you really need to set up the server and listen for connections. The rest of the processing is done by polling the stored sockets...

If you set up your IP address to 127.0.0.1 you can telnet into yourself to test it out. Choose any non-reservered port (above 1000 is safe I believe).

Is this helpful?

= Fleet

This topic is closed to new replies.

Advertisement