Forum Moderators: bakedjake

Message Too Old, No Replies

Client - Server application

I have created a chat program between teo computers.

         

digi_mind

8:26 pm on Oct 28, 2003 (gmt 0)

10+ Year Member



My chat program allows two computers to exchange data in form of thext, therefore it is a chat program.

Computer one is listening (server), so computer two (client) sends a message with its IP to computer one. Then both computers exchange data, one acts as a client, while the other one is the server, and when it has to go the other way, then one acts like the server and the other one as the client.

The problem is that both of them are client and server at the same time, it this the one to develop a program? or is it other solutions as having the client to be only the client, but at the same time to be able to recevie data?

Duckula

9:02 pm on Oct 28, 2003 (gmt 0)

10+ Year Member



The problem is that both of them are client and server at the same time

Exactly what makes you think it's a problem?

The concept of client-server is not written in stone. It's just a programming paradigm.

With your design you're effectively using the peer-to-peer paradigm. It's just a different structure, not better or worse. Of course it will scale in a different fashion than a server-client implementation, but you're only linking two machines.

It all depends on your long term requirements.

digi_mind

9:16 pm on Oct 28, 2003 (gmt 0)

10+ Year Member



I was thinking that it could be implemented in an other way, because firewalls don't allow this program to work.

The server listens in port 6180. A firewall allows a client to send data out site the internal network, but if the server is also insite an other network, behind a firewall, then how this data is supposed the reach the server?

Well, I was thinking some how to use port 80, but I have no clue on to do this.

Does anyone has an idea of how to avoid firewalls for my client-server application?

Josk

12:02 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



You can't avoid firewalls. If you ould they would be useless. How to use port 80 instead...? Well...if you've written the program to use port 6180 then just change it use port 80. Just make sure nothing else is listening to 80.

trillianjedi

12:19 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You've built this app. in a really bizarre way.

You do not need to use a "client" socket and a "server" socket. Both client and server sockets can send and receive.

If both a running on the same port, from behind a firewall, the firewall will let the traffic through.

TJ

digi_mind

9:37 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



Let me see if I understood.

I don't need to create a program that starts acting as a "client" and then when it is ready to get some information it should act as a "server".

My program works in that way, you start the program, then the client send some information, but at the same time the server in the same program is listening for some data to arrive.

What you said is that a "client" can send and receive data, so does the "server", is that what you mean?

I believe the answer is "YES", then do you have some simple code for a win32 application that I can study and see gow it works.

My program works in c++ builder, so the client and server functions are already built.