You Have Mail
Networking and no I'm not referring to any form of social interaction, is a lot like mail. Except that letters and parcels are replaced by packets and may be delivered in one of two ways. Regular postal services are a bit like UDP, they get the job done easily but can be unreliable. TCP is more like a courier service, slightly more of a hassle but with a guarantee that your message will be delivered. Packets are routed through a series of nodes, just like mail passing through a post office or depot. Eventually reaching their destination, assuming they didn't lost and awaiting your reply should you wish to respond.
Although I had experience in networking from working as a trainee at my high school, I hadn't done any network programming whatsoever. This was the second topic of the subject and I welcomed it with open arms, finding it a lot more interesting than originally expected. I suspect this is due the fact that networking and rendering both share a similar quality, in that they are considerably more rewarding than other areas for the amount of work you put in. The characteristics of both also allow much of the inner workings to be abstracted away, increasing the rate of productivity.
The task was split into two parts, with the first being a prerequisite for the second. We were given a server program that could draw a variety of shapes on screen, our mission was to write a client that communicated with that server. It was a requirement of the first task that the client allow a user to draw each supported shape, not to appear locally but be sent to the server where it can be seen by everyone connected. The second task was the addition of two-way communication, clients were now required to receive and display the cursors of other connected clients after sending its own and exporting this data to a heatmap.
Unhappy with the Winsock interface for C, I set out to write a wrapper before even attempting code catered to the task at hand. This proved to be a good move as both a learning experience and a tool that I can now reuse in future projects, not to mention how much it streamlined the remainder of the project. I called my client Packart, short for packet art as I thought fitting. It is quite primitive, click and drag of the mouse to draw shapes and arrows keys for switching between each tool and colour. Surprisingly, it still felt reasonably intuitive given the interface and was a good first project for me to begin learning SDL.
Although I had experience in networking from working as a trainee at my high school, I hadn't done any network programming whatsoever. This was the second topic of the subject and I welcomed it with open arms, finding it a lot more interesting than originally expected. I suspect this is due the fact that networking and rendering both share a similar quality, in that they are considerably more rewarding than other areas for the amount of work you put in. The characteristics of both also allow much of the inner workings to be abstracted away, increasing the rate of productivity.
The task was split into two parts, with the first being a prerequisite for the second. We were given a server program that could draw a variety of shapes on screen, our mission was to write a client that communicated with that server. It was a requirement of the first task that the client allow a user to draw each supported shape, not to appear locally but be sent to the server where it can be seen by everyone connected. The second task was the addition of two-way communication, clients were now required to receive and display the cursors of other connected clients after sending its own and exporting this data to a heatmap.
Unhappy with the Winsock interface for C, I set out to write a wrapper before even attempting code catered to the task at hand. This proved to be a good move as both a learning experience and a tool that I can now reuse in future projects, not to mention how much it streamlined the remainder of the project. I called my client Packart, short for packet art as I thought fitting. It is quite primitive, click and drag of the mouse to draw shapes and arrows keys for switching between each tool and colour. Surprisingly, it still felt reasonably intuitive given the interface and was a good first project for me to begin learning SDL.
Comments
Post a Comment