Win32 Sockets

   Command Line SMTP can be programmed using sockets very easily. SMTP or Simple Mail Transfer Protocol has a set of commands to be sent and received. If a program can send the command with the protocol and data to the SMTP server, then it can easily send e-mails. In fact even a telnet session [...]

    The third part of this Winsock tutorial  provides a useful way to handle sockets by using an Event based model. This model uses the CreateEvent function to create an event object, which can be made to wait using WSAWaitForMultipleEvents for the network events. There is also an article on Winsock select model.     When some [...]

Windows provides different models for programming with sockets. This winsock tutorial explains, one of the models which uses select function. The other winsock models are using event object, overlapped model and IO Completion port. This model design is based on Berkeley socket implementation. The basic idea is to use the select function to determine if a [...]

    There is a function gethostbyname for getting the ip address using Winsock. This function will retrieve the ip address details into a variable of type “structure hostent”.      The first step in creating this program is to ensure the socket library is initialized, if it is not initialized else-where. The next step is to [...]

  Socket programming in MFC is usually a bit messy. It’s always clean and convenient to write the socket programs using Win32.   A big advantage writing these programs in Win32 is, we can follow the same model as in any Unix C++ socket program. Also, with each and every new version of Winsock, we [...]