Monday, October 20, 2008

First Step to Socket Programming

We come to the first terms: PROTOCOL.
Maybe some of us often hear the word but dont know what is the meaning of protocol, including me.
So here we start, figure out what is the meaning of protocol..

Protocol is important when we write programs that communicate across a computer network. Protocol is the agreement on how those programs will communicate.

If we started from the high level decision, we should decide, which program is expected to initiate communication (usually, the client side) and when the responses is expected. On the other side, the server side, usually acts as a daemon that sends network messages only in response to request coming from in from the network.

FYI, daemon is a term used for a long running program.

So what is socket?
Sockets are interfaces that can "plug into" each other over a network. Once so "plugged in", the programs so connected communicate.

For getting started your journey with socket programming, I suggest you to try and analyze a socket server programs provided by the MSDN (Microsoft's Developer Network). FYI, now I'm using an October 2004 version of MSDN, and for the IDE (Integrated Development Environment), I'm using Visual Studio 2005. I'll write step by step on trying the socket, based on my experience.

reference:
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking API, Addison Wesley
http://www.troubleshooters.com/codecorn/sockets/

my team mate

where is he? i've tried to reach him, call him several times, in these several recent days..
i've also sent a message to him, but he never reply.

its ok if he want to go out of the team. But please, be a gentleman, notify me, reply my sms, my call, or just answer the phone (please)!

Maybe i would be mad, but at least each of us could step forward and continue our business..

-.- now i'm alone, doing our documentation and trying to make a big progress for our project. its kind of hard task, but i know i can, and i dont want to be failed.
Hope everything is going to be ok. Amin :)

Friday, October 17, 2008

One week before the deadline

After a month full of desperate times, now i decide to fight and continue my thesis. So here i am, staring at the monitor and feeling confuse...
I've already succeeded in compiling the program and building the project (although its a sample program from the msdn), but i dunno how to test it..
What should i do?

Browsing, browsing.. (hope i'll get some explanations about it)

getting started to winsock

Hei there, i'm really a newbie to WinSock.. so here, i try to learn by writing and save it to the blog (so I can reach it wherever I am).

This article is taken from here (copy paste -sorry-, but of course with some modifications to simplify the article as I use it for learning)

What is winsock?
1. WinSock is an abbreviation of Windows Socket
2. Its spec defines a network progrmg interface for Ms Windows, based on the "socket" paradigm popularized in BSD Unix.

Winsock 1 apps can ask Winsock to send notifications in window messages. This allows your program to handle both the network, UI issues, and background processing without having to worry about concurrency.

What is the difference between Winsock 1 and Winsock 2?
Winsock 2 adds many features. One of the most important new features is official support for multiple transport protocols. Although Winsock 1.1 was not actually limited to TCP/IP, that was the only protocol that had official support written into the spec. Winsock 2 also adds support for technical initiatives like quality of service (QoS) and multicasting.

How about Winsock 2.x?
Basically it defines two interfaces: API and SPI. Through proper use of the API, a Winsock app can work over various network transport protocols and Winsock implementations.

API
(Application Programming Interface):
shields application developers from underlying layers.

SPI
(Service Provider Interface):
allows transparent extensions to a Winsock stack.