Giter Site home page Giter Site logo

igithub14 / tcp_socket_test Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 147 KB

Test a TCP connection between two tightly coupled systems. Later, I'm gonna test a more loose coupled solution.

C 72.48% C# 27.52%
c csharp-code message-oriented-middleware enterprise-applications-integration

tcp_socket_test's Introduction

TCP_Socket_Test

This bunch of files are for testing a TCP connection between two tightly coupled homogeneous systems. Later, I'm gonna test a more loosely coupled solution.

The main goal is to make it possibile the communication between two heterogeneous systems.

In order to make the solution more loosely coupled I must remove all the dependencies one by one.

Referring to the file Tightly Coupled TCP Connection snippet.cs, I must consider the following dependencies:

• Platform Technology: internal representations of numbers and objects • Location: hard-coded machine addresses • Time: all components have to be available at the same time
• Data Format: the list of parameters and their types must match

Then: • I can use a data format that is self-describing and platform independent, such as XML • instead of sending information directly to a specific machine we should send it to an addressable 'channel' • enhance the channel to Queue up sent requests until the network and the receiving system are ready (IMPORTANT). That is why we need to wrap data inside Messages. • we also need some way to make data format transformations inside the channel, using transformers

After having configured a TCP client/server connection, I whant to implement HTTP Protocol on top of it. Note: remember that sockets sit underneath all of the typical internet protocols we use.

HTTP stays on top of TCP protocol.

At client side we write code to ask the server for particular resource. The servfer answers retreiving either the response or an error msg.

 +----------------------+
 |                      |
 |    GET /index.html   |
 |                      |
 +----------------------+
            |
            V
        `-.....-
        |       |  // serverhttp_ses
        `-.....-
        |       |
        `-.....-

a questo p.to il server risponde reestituendo il codice , se tutto è andato ok, e

        `-.....-
        |       |  // client
        `-.....-
        |       |
        `-.....-
            |
            V
 +----------------------+
 |                      |
 |     200 OK <htm>...  | //the server sends back a status code and some content (if anything was good). 
 |      ...</html>      |
 +----------------------+
            |
            V
        `-.....-
        |       |  // server
        `-.....-
        |       |
        `-.....-

Let's implement a http seerver we can access from a web browser and generates html for us. We will make use of sockets for this task.

Create: Sockets/server.c ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.