INTERNET PROGRAMMING BOOK PDF

adminComment(0)
    Contents:

Internet. Client-side Programming. Skills that are often required: • XHTML Internet Programming - XHTML .. alt = "Java How to Program book cover"/>. Text/Reference Books. ▫ Core Web Programming. ▫ Hall M & Brown L, 2nd ed, Sun Microsystems,. Prentice-Hall, ▫ Java, How to Program. ▫ Deitel H M. INTERNET PROGRAMMING / WEB PROGRAMMING UNIT 1 NOTES This book is a tutorial for the computer programming language C. Unlike BASIC or.


Internet Programming Book Pdf

Author:MARGORIE GULLATTE
Language:English, French, German
Country:Egypt
Genre:Religion
Pages:120
Published (Last):13.03.2016
ISBN:370-9-78033-609-6
ePub File Size:28.42 MB
PDF File Size:18.87 MB
Distribution:Free* [*Registration needed]
Downloads:27115
Uploaded by: XENIA

Providing tools for hands-on internet programming. ▻ There are only 9 lectures business, music, film, software, info, reports of various kinds books, search engines, education,. . application/postscript, application/pdf. ▷ zip. ▷ image/gif . An Introduction To Internet raudone.info - Download as PDF File .pdf), Text File .txt) or read online. This is how to program in the field of Internetworking. It uses the standard internet protocol suit called TCP/IP to serve billions of user worldwide. • It consists of .. XML processing programs can covert an XHTML document into PDF, RFT. Because This file is related to the book information -->.

Domains have a hierarchical structure, where the top-level domains define the type of organization to which that network belongs, and sub-domains further identify the specific network.

In this figure, the top-level domains are "gov" government agencies , "com" commercial organizations , "org" organizations and "net" service providers. The fully qualified domain name is specified by naming the host and each parent sub-domain above it, separating them with periods.

For example, the fully qualified domain name for the "jupiter" host would be "jupiter. The system "jupiter" is part of the "catalyst" domain a company's local network , which in turn is part of the "com" top-level domain a domain used by all commercial enterprises.

In order to use a hostname instead of a dot-address to identify a specific system or network, there must be some correlation between the two. This is accomplished by one of two means: a local host table or a domain name server.

A host table is a text file that lists the IP address of a host, followed by the names that it's known by. A domain name server, on the other hand, is a system that can be presented with a hostname and will return that host's IP address.

This approach is advantageous because the host information for the entire network is maintained in one centralized location, rather than being scattered about on every host on the network. Service Ports In addition to the IP address of the remote system, an application also needs to know how to address the specific program with which it wishes to communicate. This is accomplished by specifying a service port, a bit number that uniquely identifies an application running on the system.

Instead of numbers, however, service names are usually used instead. Like hostnames, service names are usually matched to port numbers through a local file, commonly called services. This file lists the logical service name, followed by the port number and protocol used by the server. A number of standard service names are used by Internet-based applications and these are referred to as well-known services.

Remember that a service name or port number is a way to address an application running on a remote host. Because a particular service name is used, it doesn't guarantee that the service is available, just as dialing a telephone number doesn't guarantee that there is someone at home to answer the call.

The next step is for the program to create what is called a socket, a communications end-point that can be likened to a telephone. However, creating a socket by itself doesn't let you exchange information, just like having a telephone in your house doesn't mean that you can talk to someone by simply taking it off the hook.

You need to establish a connection with the other program, just as you need to dial a telephone number, and to do this you need the address of the application to which you want to connect. This address consists of three key parts: the protocol family, Internet Protocol IP address and the service port number. We've already talked about the IP address and service port, but what's the protocol family? It's a number which is used to logically designate the group to which a given protocol belongs.

Since the socket interface is general enough to be used with several different protocols, the protocol family tells the underlying network software which protocol is being used by the socket. In our case, the Internet Protocol family will always be used when creating sockets. With the protocol family, IP address of the system and the service port number, you're ready to establish a connection.

As mentioned previously, when two programs wish to use TCP to exchange data, one of the programs must assume the role of the client, while the other must assume the role of the server. The client application initiates what is called an active open. It creates a socket and actively attempts to connect to a server.

The server application creates a socket and passively listens for incoming connections from clients, performing what is called a passive open.

Internet Programming with Java Book

When the client initiates a connection, the server is notified that some process is attempting to connect with it. By accepting the connection, the server completes what is called a virtual circuit, a logical communications pathway between the two programs. It's important to note that the act of accepting a connection creates a new socket; the original socket remains unchanged so that it can continue to be used to listen for additional connections.

When the server no longer wishes to listen for connections, it closes the original passive socket. To review, there are five significant steps that a program which uses TCP must take to establish and complete a connection. The server side would follow these steps: 1. Create a socket.

Listen for incoming connections from clients. Accept the client connection, creating a new socket. Send and receive information. Close the socket when finished, terminating the conversation.

In the case of the client, these steps are followed: 1. Specify the address and service port of the server program. Establish the connection with the server. Only steps two and three are different, depending on if it's a client or server application. When creating a server application, it is generally desirable to use a multi-threaded design. When the connection is closed, the thread can either be terminated or put to sleep until a new client connection has been accepted.

This kind of implementation has a number of advantages, particularly on systems with multiple processors. A multi-threaded server is able to handle a larger number of client connections more efficiently, and generally it is easier to implement and debug because each client session operates independently from the others.

Asynchronous Sockets One of the first issues you'll encounter when developing your Internet application is the difference between synchronous and asynchronous sockets. Whenever you perform some operation on a socket, it may not be able to complete immediately and return control back to your program.

For example, reading data from a socket cannot complete until some data has been sent by the remote host. If there is no data waiting to be read, one of two things can happen: the method can wait until some data has been written on the socket, or it can return immediately with an error that indicates that there is no data to be read. The first type of socket is called a synchronous or blocking socket.

In other words, the program is "blocked" until the request for data has been satisfied. When the remote system does write some data on the socket, the read operation will complete and execution of the program will resume.

The second type of socket is called an asynchronous or non-blocking socket, and requires that the application recognize the error condition and handles the situation appropriately.

Programs that use asynchronous sockets typically use one of two methods when sending and receiving data. One method is to have the program periodically attempt to read or write data from the socket, typically using a timer. However, this can result in higher CPU utilization and negatively impact the overall performance of the system. The preferred method is to use what is called asynchronous notification. This means that the program is notified whenever a socket event takes place, and in turn can respond to that event.

For example, if the remote program writes some data to the socket, an event is generated so that program knows it can read the data from the socket at that point. However, this can introduce some problems on the Windows platform.

When the socket blocks, it will either cause the current thread to sleep, or it will process Windows messages sent to the application.

This can either result in the program appearing to become non-responsive or it may be re-entered at a different point with the blocked operation parked on the program's stack. For example, consider a program that attempts to read some data from the socket when a button is pressed. Because no data has been written yet, it blocks and the program goes into a message loop. The user then presses a different button, which causes code to be executed, which in turn attempts to read data from the socket, and so on.

To resolve this issue with blocking sockets, the Windows Sockets standard states that there may only be one outstanding blocked call per thread of execution. This means that applications that are re-entered as in the example above will encounter errors whenever they try to take some action while a blocking function is already in progress.

The creation of background worker threads to perform blocking socket operations is a common approach to address this issue.

This allows the main user interface thread to continue to process Windows messages and remain responsive to the user. It should be noted that there are advantages to using blocking sockets. In most cases, the application design and implementation is simpler, and overall throughput the rate at which data is sent and received is generally higher with blocking sockets because it does not have to go through an event mechanism to notify the application of a change in status.

The SocketWrench component facilitates the use of non-blocking sockets by firing events when appropriate. For example, an OnRead event is generated whenever the remote host writes on the socket, which tells your application that there is data waiting to be read.

In summary, there are three general approaches that can be taken when building an application: Use a synchronous blocking socket. In this mode, the program will not resume execution until the socket operation has completed.

If multiple simultaneous connections must be established by the application, it is recommended that you use a multi-threaded design, where each session is managed by its own worker thread. Use an asynchronous non-blocking socket. This mode allows your application to respond to events.

For example, when the remote system writes data to the socket, an OnRead event is generated for the control. Your application can respond by reading the data from the socket, and perhaps send some data back, depending on the context of the data received. Use a combination of blocking and non-blocking socket operations. The ability to switch between blocking and non-blocking modes "on the fly" provides a powerful and convenient way to perform socket operations.

If you decide to use asynchronous sockets in your application, it's important to keep in mind that you must check the return value from every read and write operation, since it is possible you may not be able to send or receive all the specified data.

Developers frequently encounter problems when they write a program that assumes a given number of bytes can always be written to, or read from, the socket. In many cases, the program works as expected when developed and tested on a local area network, but fails unpredictably when the program is released to a user that has a slower network connection such as a serial dial-up connection to the Internet.

By always checking the return values of these operations, you insure that your program will work correctly, regardless of the speed or configuration of the network. Secure Communications Security and privacy is a concern for everyone who uses the Internet, and the ability to provide secure transactions over the Internet has become one of the key requirements for many business applications. SocketWrench has the ability to establish secure connections with remote servers, as well as function as a secure server itself.

Although most of the technical issues such as data encryption are handled internally by the control and library, a general understanding of the standard security protocols is useful when designing your own applications. When you establish a connection to a server over the Internet for example, a web server , the data that you exchange is typically routed over dozens of computer systems until it reaches its destination.

Any one of these systems may monitor and log the data that it forwards, and there is no way for either the sender or receiver of that data to know if this has been done. Exchanging information over the Internet could be likened to talking with someone in a public restaurant. Anyone can choose to listen to what you're saying, and unless they introduce themselves, you have no idea who they are or if they've even heard what you said. To ensure that private information can be securely exchanged over the Internet, two basic requirements must be met: there must be a way to send that information so that only the sender and the receiver can understand what is being exchanged, and there must be a way for them to determine that they each are in fact who they claim to be.

The solution to the first problem is to use encryption, where a key is used to encrypt and decrypt the data using a mathematical formula. The second problem is addressed by using digital certificates. These certificates are issued by a Certification Authority CA , which is a trusted third-party organization who verifies the identity of the individual or company who is issued a certificate.

These two concepts, encryption and digital certificates, are combined to provide the means to send and receive information securely over the Internet. Each of these protocols were designed to provide essentially the same thing: a private exchange of encrypted data between the sender and receiver, making it unreadable by an intermediate system.

Using the restaurant analogy, it would be as if two people were speaking in a language that only they could understand. Although someone sitting at the next table could listen in on the conversation, they wouldn't have any idea what was actually being said. A secure connection, for example between a web browser and a server, begins with what is called the handshake phase where the client and server identify themselves.

When the client first connects with the server it sends a message to the server and the server responds with its digital certificate, along with its public key and information about what type of encryption it would like to use.

Next, the client generates a master key and sends this key to the server, which authenticates it. Once the client and server have completed this exchange, keys are generated which are used to encrypt and decrypt the data that is exchanged.

With the handshake completed, a secure connection between the client and server is established. SocketWrench handles the handshake phase of the secure connection transparently and does not require any additional programming.

If a secure connection cannot be established, an error is returned and the network connection is closed. After the handshake phase has completed, the client may choose to examine the digital certificate returned by the server.

The information contained in the certificate includes the date it was issued, the date it expires, information about the organization who issued the certificate called the issuer and to whom the certificate was issued called the subject of the certificate.

The client may also validate the status of the certificate, determining if it was issued by a trusted Certification Authority and was returned by the same company or individual it was issued to. There may be certain cases where the client determines there's a problem with the certificate for example, if the certificate's common name does not match the domain name of the server , but chooses to continue communicating with the server.

Note the connection with the server will still be secure in this case. In other cases, for example if the certificate has expired, the client may choose to terminate the connection and warn the user.

Digital Certificates With secure Internet connections, digital certificates are used to exchange public keys for data encryption and to provide identification information. This information typically includes the organization that was issued the certificate, its physical location and so on. The certificate itself is used to validate the public key actually belongs to the entity it was issued to.

The certificate also includes information about the Certification Authority CA who issued the certificate. The Certification Authority is responsible for validating the information provided by that organization, and then digitally signing the certificate, establishing a relationship between the two entities.

When others validate the certificate, they know it has been issued by a trusted thirdparty. For example, let's say that a company wants to implement a secure site so that people can order products online. They would provide information about their company organizational contacts, financial information and so on to a trusted third party organization such as Verisign. Verisign would then verify that the information they provided was complete and correct, and then would issue a signed certificate to them, which they install on their server.

When a user client system connects to their server and checks the certificate, they see that it was issued by Verisign, a trusted Certification Authority. In essence, the user is saying that because they trust Verisign, and Verisign trusts the company the certificate was issued to, they will trust the company as well. To establish this relationship between the Certification Authority and the organization the certificate is issued to, there needs to be a root certificate which has been signed by the same trusted organization.

This serves as the beginning of the certification path that is used to validate signed certificates. Using the above example, on the user's system there is a root certificate for Verisign, signed by Verisign.

Root certificates are maintained in the local system's certificate store which is essentially a database of digital certificates. This database is structured so that different types of certificates can be organized in one central location on the system, and a standard interface is provided to enumerate and validate these certificates. Certificates are associated with a store name, allowing them to be easily categorized. For example, root certificates are stored under the name "Root", while a user's personal certificates along with their private keys are stored under the name "My".

When the Windows operating system is installed, there is a certificate store that contains the root certificates for the major Certification Authorities. However, there are situations where additional certificates may need to be added to the system. To facilitate this, the system management console can be used to install certificates, as well as export or remove certificates from the certificate store.

When managing your system's certificate store, you should exercise the same caution as when you make changes to the system registry.

Inadvertently removing a certificate could result in errors when attempting to access secure systems. In general, the one situation where certificate management becomes important is when you want to develop your own secure server. This is because your server needs to have a signed certificate to send to the client in order to establish the secure connection.

For general-purpose commercial applications, this generally means you would need to obtain a certificate signed by a Certification Authority such as Verisign. This certificate would then be installed in the certificate store on the server. For development and testing purposes it may be inconvenient to download a certificate. There also may be situations in which an organization wishes to function as its own Certification Authority and issue certificates themselves.

This allows the organization to control how certificates are managed and can be ideal for secure applications that are designed for the corporate intranet. SocketWrench includes CreatCert, a utility that enables you to create your own self-signed root certificates and server certificates.

For more information, refer to the documentation included with SocketWrench. NET and a working Internet connection. The first step after starting Visual Studio is to create a new Visual Basic project. A new project will be created with a single, empty form. After the project has been created, the next step is to add SocketWrench.

NET to your new project. Select Project Add Reference from the menu and a dialog will be displayed which lists the available components. Scroll down to where SocketTools. SocketWrench is displayed, select it and then click on the OK button. The User Interface After the SocketWrench component has been referenced in your project, the next step is to create the user interface. We'll add several Label and TextBox controls, and a Button control.

In this example, the large TextBox control in the center of the form has the Multiline property set to True, the WordWrap property is set to False, and the ScrollBars property is set to Both. This will enable us to view the complete document that's retrieved from the web server and scroll through the contents. We have also initialized the TextBox controls with default values that we'll use with this example.

When the application is completed, you will be able to specify the name of the web server, the port number, a timeout period in seconds, and the document that you wish to view.

Clicking the OK button will establish a connection with the server, request the document and then retrieve the contents of the document that the server returns. With the user interface portion of the example complete, the next step is to write the code that will retrieve the document from the server.

To do this, select View Code from the menu, and an editor will display the empty form class. Initializing SocketWrench The first step is creating an instance of the SocketWrench component and then initializing that instance. To create an instance of SocketWrench, we'll create a private member variable in the form's class that references the component, and name it as Socket: Imports SocketTools.

While TCP will guarantee that the data will arrive intact. For example. Applications which make assumptions about the amount of data they can read or write in a single operation may work in some environments. Exchange the data as fixed length structures. Once the connection has been established. In some situations it may be desirable to design the application to exchange information as discrete messages or blocks of data.

This series of steps is important because it ensures that the bytes of data exchanged between the client and server will be received in the same order they were sent. While it is convenient to think of these as discrete blocks of data. While this isn't directly supported by TCP. The client may receive that data in a single read on the socket.

The first step is for the client to send a synchronization SYN packet to the server that contains its sequence number. A general rule to use when designing an application using TCP is to consider how the program would handle the situation where the read operation only returns a single byte.

TCP considers it a stream of bytes. With the limitations of UDP. Much of the work that TCP does transparently such as generating checksums. A combination of the above methods. This would effectively create an "envelope" around the data being exchanged.

In situations where speed is paramount. When using asynchronous non-blocking sockets. Commands are sent as one or more printable characters. Regardless of the method used. Prefix variable-length data structures with the number of bytes being sent. This is the approach that many Internet application protocols use. The length value could be expressed either as a native integer value.

Data is exchanged in discrete units called datagrams. The message length and even additional information such as a CRC checksum or MD5 hash can be used to validate the integrity of the data.

Prefix the data with a unique byte or byte sequence that would normally not be found in the data stream. A common use of UDP is with video and audio streaming. This means that the sender and receiver must typically implement their own acknowledgement protocol on top of UDP. This allows the receiver to read this fixed length value. Because TCP is a reliable protocol. UDP is often the preferred solution. UDP is sometimes referred to as an unreliable protocol because when a program sends a UDP datagram over the network.

This would be followed by the data itself. Before an application can exchange data with another computer system. A host table is a text file that lists the IP address of a host. A domain name server. Typically this file is named hosts and is found in the C: This address is typically expressed either as its numerical value in dot-notation. Like an address in dot-notation.

This is accomplished by one of two means: The fully qualified domain name is specified by naming the host and each parent sub-domain above it. In this figure. Domains have a hierarchical structure. This approach is advantageous because the host information for the entire network is maintained in one centralized location.

In order to use a hostname instead of a dot-address to identify a specific system or network. The system "jupiter" is part of the "catalyst" domain a company's local network.

The first is the Internet Protocol address of the remote host. Like hostnames. We've already talked about the IP address and service port.

The next step is for the program to create what is called a socket. A number of standard service names are used by Internet-based applications and these are referred to as well-known services. It's important to note that the act. This address consists of three key parts: Since the socket interface is general enough to be used with several different protocols. IP address of the system and the service port number. With the protocol family. This file lists the logical service name.

You need to establish a connection with the other program. In our case. This is accomplished by specifying a service port. The client application initiates what is called an active open. It's a number which is used to logically designate the group to which a given protocol belongs. By accepting the connection.

These services are defined by a standards document and include common application protocols such as FTP. Remember that a service name or port number is a way to address an application running on a remote host. Service Ports In addition to the IP address of the remote system. Because a particular service name is used. It creates a socket and actively attempts to connect to a server. Internet Protocol IP address and the service port number. Like the hosts file. The server application creates a socket and passively listens for incoming connections from clients.

As mentioned previously. Instead of numbers. When the client initiates a connection.

Create a socket. Only steps two and three are different. Accept the client connection. When the server no longer wishes to listen for connections.

In the case of the client. When the connection is closed. In other words. Whenever you perform some operation on a socket. Send and receive information.

Asynchronous Sockets One of the first issues you'll encounter when developing your Internet application is the difference between synchronous and asynchronous sockets. The first type of socket is called a synchronous or blocking socket. This kind of implementation has a number of advantages.

A multi-threaded server is able to handle a larger number of client connections more efficiently. Close the socket when finished. Listen for incoming connections from clients. After accepting the connection. When the remote system does write some data on the socket. Establish the connection with the server. The server side would follow these steps: The second type of socket is called an asynchronous or non-blocking socket. If there is no data waiting to be read.

When creating a server application. To review. Specify the address and service port of the server program.

This means that applications that are re-entered as in the example above will encounter errors whenever they try to take some action while a blocking function is already in progress. In summary. The SocketWrench component facilitates the use of non-blocking sockets by firing events when appropriate. Because no data has been written yet. In most cases. The creation of background worker threads to perform blocking socket operations is a common approach to address this issue.

This mode allows your application to respond to events.

Your application can respond by reading the data from the socket. Use an asynchronous non-blocking socket. If multiple simultaneous connections must be established by the application. It should be noted that there are advantages to using blocking sockets. Use a synchronous blocking socket. This can either result in the program appearing to become non-responsive or it may be re-entered at a different point with the blocked operation parked on the program's stack. One method is to have the program periodically attempt to read or write data from the socket.

Programs that use asynchronous sockets typically use one of two methods when sending and receiving data. The preferred method is to use what is called asynchronous notification. To resolve this issue with blocking sockets. By default. In this mode. The user then presses a different button. This allows the main user interface thread to continue to process Windows messages and remain responsive to the user.

This means that the program is notified whenever a socket event takes place. When the socket blocks. Developers frequently encounter problems when they write a program that assumes a given number of bytes can always be written to. Microsoft also developed a protocol similar to SSL.

Any one of these systems may monitor and log the data that it forwards. To ensure that private information can be securely exchanged over the Internet. Secure Communications Security and privacy is a concern for everyone who uses the Internet. By always checking the return values of these operations. Anyone can choose to listen to what you're saying.

SocketWrench has the ability to establish secure connections with remote servers. The ability to switch between blocking and non-blocking modes "on the fly" provides a powerful and convenient way to perform socket operations. If you decide to use asynchronous sockets in your application. Exchanging information over the Internet could be likened to talking with someone in a public restaurant.

These two concepts. The second problem is addressed by using digital certificates. When you establish a connection to a server over the Internet for example. These certificates are issued by a Certification Authority CA. The solution to the first problem is to use encryption. Use a combination of blocking and non-blocking socket operations.

Although most of the technical issues such as data encryption are handled internally by the control and library. In many cases. When the client first connects with the server it sends a message to the server and the server responds with its digital certificate. This information typically includes the organization that was issued the certificate. The client may also validate the status of the certificate. The information contained in the certificate includes the date it was issued.

The Certification Authority is responsible for validating the information provided by that organization.

TextBox1.Text = Integer.Parse(TextBox2.Text) server, and display

Digital Certificates With secure Internet connections. With the handshake completed. SocketWrench handles the handshake phase of the secure connection transparently and does not require any additional programming. Note the connection with the server will still be secure in this case. There may be certain cases where the client determines there's a problem with the certificate for example. Using the restaurant analogy.

Although someone sitting at the next table could listen in on the conversation. In other cases. Each of these protocols were designed to provide essentially the same thing: The certificate itself is used to validate the public key actually belongs to the entity it was issued to.

A secure connection. Once the client and server have completed this exchange. They would provide information about their company organizational contacts. When others validate the certificate. The certificate also includes information about the Certification Authority CA who issued the certificate. If a secure connection cannot be established. After the handshake phase has completed. This database is structured so that different types of certificates can be organized in one central location on the system.

When managing your system's certificate store. Root certificates are maintained in the local system's certificate store which is essentially a database of digital certificates. This serves as the beginning of the certification path that is used to validate signed certificates. In essence. To establish this relationship between the Certification Authority and the organization the certificate is issued to.

Using the above example. When a user client system connects to their server and checks the certificate. To facilitate this. Certificates are associated with a store name. When the Windows operating system is installed. A new project will be created with a single. Inadvertently removing a certificate could result in errors when attempting to access secure systems.

This allows the organization to control how certificates are managed and can be ideal for secure applications that are designed for the corporate intranet. NET and a working Internet connection. For this example. Select File New Project from the menu. The first step after starting Visual Studio is to create a new Visual Basic project. For development and testing purposes it may be inconvenient to download a certificate.

In general. There also may be situations in which an organization wishes to function as its own Certification Authority and issue certificates themselves. For more information. SocketWrench includes CreatCert.

This certificate would then be installed in the certificate store on the server. For general-purpose commercial applications.

INTERNET PROGRAMMING / WEB PROGRAMMING UNIT 1 NOTES

This is because your server needs to have a signed certificate to send to the client in order to establish the secure connection.

Select Project Add Reference from the menu and a dialog will be displayed which lists the available components. NET to your new project. SocketWrench is displayed. We'll add several Label and TextBox controls. After the project has been created.

Scroll down to where SocketTools. This is done by calling the Initialize method. Imports SocketTools. To do this. This will enable us to view the complete document that's retrieved from the web server and scroll through the contents. We have also initialized the TextBox controls with default values that we'll use with this example. In this example. Initializing SocketWrench The first step is creating an instance of the SocketWrench component and then initializing that instance.

With the user interface portion of the example complete. Clicking the OK button will establish a connection with the server. SocketWrench End Class Next. When the application is completed. To create an instance of SocketWrench. NET garbage collector will eventually do this for you. It will close any active network connection created by that instance of SocketWrench. For each call to the Initialize method. EventArgs Handles Me. Establishing a Connection After an instance of the SocketWrench component has been created and initialized.

Because sockets are a limited system resource. Failure can indicate that there was a problem loading the networking subsystem. Although the. Here's what our Click event handler looks like so far: In turn. It's important to note that the Connect method can be called in several different ways. Once this is done. A good place to call the Uninitialize method is in the FormClosed event: We'll do this in the Click event handler for our Button control that was placed on the form.

Uninitialize End Sub The Uninitialize method is typically invoked immediately before the application terminates. A good place to call the Initialize method is in the form's Load event. To connect to the server. FormClosed Socket. If you continue to encounter this error. ByVal e As System. Initialize Then MessageBox. In that case.

Load If Not Socket. The TextBox1 control specifies the server name or IP address. Requesting the Document Once the connection has been established. Parse TextBox3. Parse TextBox2. This is very similar to how a line of text is written to a text file. Text ' Establish a connection with the ' an error message if the connection attempt fails. Text server.

If Not Socket. If it returns False. This means you should never check the value of the LastError property to determine if the previous method has failed.

One important thing to keep in mind using the LastError and LastErrorString properties is that their values are only meaningful if the previous method indicates an error has actually occurred. If the method returns True. EventArgs Handles B utton1. Click ' Initialize the SocketWrench properties. The RemotePortproperty specifies the port number that will be used to establish the connection. There is also a property named LastError which returns a numeric error code that identifies the last error that has occurred.

The HostName property specifies the host name or IP address of the server that we want to connect to. Connect Then MessageBox. RemotePort Socket. HostName Socket. The Timeout property specifies the number of seconds to wait for the connection to be established. Here's our updated code in the Click event handler to send the request to the server: Show Socket. To send this command. SocketWrench also provides a more general purpose Write method which can be used to send data stored in a byte array.

Here is the complete code for the Click event handler: It's important to note that WriteLine is not the only way that you can send data to a server. Text Then MessageBox.More information and a free evaluation copy of both SocketWrench and SocketTools is available on the Catalyst Development website atwww. This address consists of three key parts: A number is used to reference the standards document for each protocol.

If it returns False, an error has occurred. With the handshake completed. In general. CertificateIssued This property returns the date the server's certificate was issued by the certificate author is later than the current date.

A number of standard service names are used by Internet-based applications and these are referred to as well-known services. Built on top of IP, TCP offers a reliable, full-duplex byte stream that may be read and written to in a fashion similar to reading and writing a file.

CHANELL from Tucson
See my other posts. I'm keen on beatboxing. I do enjoy sharing PDF docs freely.
>