Client-Server Connection

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

36 Replies - 5887 Views - Last Post: 27 October 2010 - 05:43 PM Rate Topic: -----

#1 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Client-Server Connection

Posted 25 October 2010 - 11:32 AM

I'm needing some ideas on how emulates the connection between client and server for exchanging packets between them.

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Client-Server Connection

#2 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 25 October 2010 - 04:29 PM

There is a sender and a recipient who trade "packages," in parallel.
The packages will use the idea IPv4 (fragment the packets)
I will use 3-way handshake and the algorithm Go Back N

I think I'll need one class for client and another to server. What will I need in each class and how can I make the connection between them?
Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10185
  • View blog
  • Posts: 37,600
  • Joined: 27-December 08

Re: Client-Server Connection

Posted 25 October 2010 - 04:37 PM

Have you checked out the DIC Tutorials and Snippets sections yet? I'm sure there is a good client-server tutorial.
Was This Post Helpful? 0
  • +
  • -

#4 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 25 October 2010 - 05:44 PM

View Postmacosxnerd101, on 25 October 2010 - 03:37 PM, said:

Have you checked out the DIC Tutorials and Snippets sections yet? I'm sure there is a good client-server tutorial.


I did not find anything about client-server
Was This Post Helpful? 0
  • +
  • -

#5 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10185
  • View blog
  • Posts: 37,600
  • Joined: 27-December 08

Re: Client-Server Connection

Posted 25 October 2010 - 05:49 PM

On the second page, I found a Networking Tutorial. Also, even if you do not find what you are looking for on the DIC Tutorials, use your favorite search engine to look for some resources. That way, you have done some preliminary research and can ask more targeted questions that will allow us to better help you. :)
Was This Post Helpful? 1
  • +
  • -

#6 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 25 October 2010 - 06:03 PM

View Postmacosxnerd101, on 25 October 2010 - 04:49 PM, said:

On the second page, I found a Networking Tutorial. Also, even if you do not find what you are looking for on the DIC Tutorials, use your favorite search engine to look for some resources. That way, you have done some preliminary research and can ask more targeted questions that will allow us to better help you. :)


In this tutorial you posted, what is the socket? I will do everything in memory (simulating) and I'll replace it messages. The socket would be the buffer?
Was This Post Helpful? 0
  • +
  • -

#7 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 26 October 2010 - 06:10 AM

Let me see... I need:

Client:
Create a TCP socket
Establish connection
Communicate
Close the connection


Server:
Create a TCP socket
Assign a port to socket
Set socket to listen
Repeatedly:
-Accept new connection
-Communicate
-Close the connection


How can I create a TCP socket ? What do I need to create? How do I set up the client and server classes?
Was This Post Helpful? 0
  • +
  • -

#8 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2247
  • View blog
  • Posts: 9,237
  • Joined: 18-February 07

Re: Client-Server Connection

Posted 26 October 2010 - 06:28 AM

Basically the root question is: Why simulate, why not just use a local TCP-IP connection?

BUT, if you need to simulate the question is: how realistic does your simulation need to be. It is possible to setup something really simple using IO streams or something really complicated that can simulate network problems etc.
Was This Post Helpful? 0
  • +
  • -

#9 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: Client-Server Connection

Posted 26 October 2010 - 06:33 AM

Beej's Guide
Was This Post Helpful? 0
  • +
  • -

#10 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 26 October 2010 - 11:17 AM

View PostNickDMax, on 26 October 2010 - 05:28 AM, said:

Basically the root question is: Why simulate, why not just use a local TCP-IP connection?

BUT, if you need to simulate the question is: how realistic does your simulation need to be. It is possible to setup something really simple using IO streams or something really complicated that can simulate network problems etc.


The filling of the buffer and thus packet loss (loss with a probability X).
It will all be in memory, I will not use a local network
Was This Post Helpful? 0
  • +
  • -

#11 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2247
  • View blog
  • Posts: 9,237
  • Joined: 18-February 07

Re: Client-Server Connection

Posted 26 October 2010 - 11:36 AM

Well I would probably use a queue-like data structure to store "packets".


enqueue would be like transmit.
dequeue would be like receive.
Was This Post Helpful? 0
  • +
  • -

#12 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 26 October 2010 - 02:35 PM

Code::Blocks does not recognize:

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>



Error:
No such file or directory
Was This Post Helpful? 0
  • +
  • -

#13 Jacic  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 54
  • Joined: 15-June 10

Re: Client-Server Connection

Posted 26 October 2010 - 03:15 PM

Are you sure you have those files in the correct directories and have told CodeBlocks to look in those directories?
Was This Post Helpful? 0
  • +
  • -

#14 Apprentice123  Icon User is offline

  • D.I.C Regular

Reputation: -16
  • View blog
  • Posts: 265
  • Joined: 30-June 08

Re: Client-Server Connection

Posted 26 October 2010 - 03:43 PM

View PostJacic, on 26 October 2010 - 02:15 PM, said:

Are you sure you have those files in the correct directories and have told CodeBlocks to look in those directories?


These includes, are not standard with the compiler?
Was This Post Helpful? 0
  • +
  • -

#15 Jacic  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 54
  • Joined: 15-June 10

Re: Client-Server Connection

Posted 26 October 2010 - 03:53 PM

I dont think so, because I didnt get any of those when I installed CodeBlocks.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3