resource
//----------
A resource is something that, once you're done using it, you need to return to the system. If you don't, bad things happen.
In C++ programs, the most commonly used resource is dynamically allocated memory (if you allocate memory and never deallocate it, you've got a memory leak), but memory is only one of many resources you must manage.
Other common resources include file descriptors, mutex locks, fonts and brushes in graphical user interfaces (GUIs), database connections, and network sockets.
Regardless of the resource, it's important that it be released when you're finished with it.
//===========================================================
what's port numbers?
//-----------------------------------
To request for service from a server, an obvious method is designating a server
by it's process ID and a host ID.
However, process IDs are assigned chronologically by process creation time, so the client
can't know in advance the process ID of a particular server process on a host.
To resolve this problem, the client uses a port number to specify a particular service,and
the server process created for that service can use that port number to handle the client's request.
//-----------------------
chronological: [ ˌ krɔnə'lɔdʒikəl ] arranged according to the order of time.
//=============================
Balance
//----------
A resource is something that, once you're done using it, you need to return to the system. If you don't, bad things happen.
In C++ programs, the most commonly used resource is dynamically allocated memory (if you allocate memory and never deallocate it, you've got a memory leak), but memory is only one of many resources you must manage.
Other common resources include file descriptors, mutex locks, fonts and brushes in graphical user interfaces (GUIs), database connections, and network sockets.
Regardless of the resource, it's important that it be released when you're finished with it.
//===========================================================
what's port numbers?
//-----------------------------------
To request for service from a server, an obvious method is designating a server
by it's process ID and a host ID.
However, process IDs are assigned chronologically by process creation time, so the client
can't know in advance the process ID of a particular server process on a host.
To resolve this problem, the client uses a port number to specify a particular service,and
the server process created for that service can use that port number to handle the client's request.
//-----------------------
chronological: [ ˌ krɔnə'lɔdʒikəl ] arranged according to the order of time.
//=============================
Balance
There are no perfect structure . There are only structure that try to balance the current cost and benefit.
Pattern is something that comes with both costs and benefits.You should find yourself using the ones that best fit the problem at hand. -----《Agile Software Development》