BSD Sockets Programming from a Multi-Language Perspective by M. Tim Jones

By M. Tim Jones

BSD Sockets Programming from a Multi-Language viewpoint is written for software program builders who have to create various community purposes. It starts off through detailing the effective and potent makes use of of the BSD Sockets API for networked program improvement in a number of languages. From there the BSD API is roofed intimately and the aim of every functionality and socket choice is pointed out, together with the complex behavioral side-effects of every. Having a radical figuring out of those concerns and strategies is usually the variation among being a amateur community software developer. Optimizing networked functions and averting universal pitfalls also are addressed. After the forged foundational insurance of the Sockets API partly I, half II investigates it from a number of language views. utilizing six diverse languages in all, together with relevant languages (C), object-oriented languages (Java), and scripting languages (Perl), you examine the benefits and drawbacks of every language as they relate to the advance of networked purposes and the Sockets API. ultimately, partly III, a suite of software program styles is mentioned for every language. styles contain an easy HTTP server and SMTP customer, and numerous Sockets communique types (stream, datagram, multicast, and broadcast). those styles can be utilized because the foundation for extra complicated functions or to provide you a quick-start while construction networked functions. The styles additionally remove darkness from the variations among the community APIs for every language and establish how yes languages make styles basic and others cause them to advanced. The accompanying CD-ROM contains the entire resource code from the booklet, together with the styles distinct partially III, in addition to open resource interpreters and different instruments.

Show description

Read Online or Download BSD Sockets Programming from a Multi-Language Perspective PDF

Similar software design & engineering books

Distributed Services with OpenAFS: for Enterprise and Education

This publication exhibits intimately find out how to construct enterprise-level safe, redundant, and hugely scalable companies from scratch on most sensible of the open resource Linux working process, compatible for small businesses in addition to large universities. The center structure awarded relies on Kerberos, LDAP, AFS, and Samba. it's proven the best way to combine net, message similar, information base and different prone with this spine.

Creating Mac Widgets with Dashcode (Firstpress)

With the appearance of Mac OSX Leopard and Dashcode, it has develop into really easy to jot down your individual widgets (small courses that usually do one task). Even enterprise humans can write little courses to do such things as graph revenues that immediately replace. So this booklet is written for all clients who will want to create their very own widgets.

Beyond Redundancy: How Geographic Redundancy Can Improve Service Availability and Reliability of Computer-Based Systems

How Geographic Redundancy Can increase carrier Availability and Reliability of Computer-Based SystemsEnterprises make major investments in geographically redundant structures to mitigate the impossible chance of a ordinary or man-made catastrophe rendering their fundamental web site inaccessible or destroying it thoroughly.

Additional info for BSD Sockets Programming from a Multi-Language Perspective

Example text

This example is the more traditional use of the bind function in which all interfaces are permitted for incoming connections to the server application. This functionality is configured using the INADDR_ANY symbolic constant, which represents the wildcard address (all available interfaces). In this example, clients can connect to the server application through either interface; neither will refuse connections. 2: Binding the wildcard address to a server socket. Finally, let’s look at a client example.

Unix-like systems utilize the fcntl system call for this purpose, whereas some stacks provide a socket option for this purpose. Finally, the MSG_DONTROUTE flag disables routing algorithms on the local host for this emission. 2007 23:21:04] send/sendto Function packet to the destination (first hop). With this flag set, no routing is performed and the resulting packet is emitted as if the destination was on the local subnet. The send and sendto functions return either the number of bytes queued for transmission in the socket, or a –1 if a local error was detected.

We complete this quick introduction with a look at a sample client and server application that can communicate over the Internet using the stream model of communication. All code for this chapter can be found on the companion CD-ROM under /software/ch2. Note Except for line numbers, boldface is used only for functions that are part of the Socket API in code listings and in the text. It is used to emphasize what is networking specific. This convention is followed in this chapter and throughout the book.

Download PDF sample

Rated 4.01 of 5 – based on 8 votes