Learning Network Programming with Java 1st Edition Reese Richard M instant download
Learning Network Programming with Java 1st Edition Reese Richard M instant download
https://textbookfull.com/product/learning-network-programming-
with-java-1st-edition-reese-richard-m/
https://textbookfull.com/product/learning-java-functional-
programming-1st-edition-reese-richard-m/
https://textbookfull.com/product/natural-language-processing-
with-java-community-experience-distilled-1st-edition-reese-
richard-m/
https://textbookfull.com/product/ejb-3-1-cookbook-1st-edition-m-
reese-richard/
https://textbookfull.com/product/learning-java-beginning-
programming-with-java-for-dummies-first-edition-john-bach/
Java Network Programming Fourth Edition Harold Elliotte
https://textbookfull.com/product/java-network-programming-fourth-
edition-harold-elliotte/
https://textbookfull.com/product/learning-java-an-introduction-
to-real-world-programming-with-java-marc-loy/
https://textbookfull.com/product/learning-java-an-introduction-
to-real-world-programming-with-java-5th-edition-marc-loy/
https://textbookfull.com/product/java-for-data-science-1st-
edition-reese/
https://textbookfull.com/product/neural-network-programming-with-
java-create-and-unleash-the-power-of-neural-networks-by-
implementing-professional-java-code-1st-edition-souza/
© CHB Books
© CHB Books
Richard M Reese
BIRMINGHAM - MUMBAI
© CHB Books
Learning Network Programming with Java
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
www.packtpub.com
© CHB Books
Credits
Reviewer Proofreader
Daniel MÜHLBACHLER Safis Editing
Technical Editor
Humera Shaikh
Copy Editor
Priyanka Ravi
© CHB Books
Richard M Reese has worked in both industry and academia. For 17 years, he
worked in the telephone and aerospace industries, serving in several capacities,
including research and development, software development, supervision, and
training. He currently teaches at Tarleton State University, where he has the
opportunity to apply his years of industry experience to enhance his teaching.
Richard has written several Java books and a C Pointer book. He uses a concise and
easy-to-follow approach to topics at hand. His Java books have addressed EJB 3.1,
updates to Java 7 and 8, certification, functional programming, jMonkeyEngine, and
natural language processing.
Furthermore, he works with some database management systems based on SQL, and
also some NoSQL systems, such as MongoDB, and SOLR. This is also reflected in
several projects that he is currently involved in at Catalysts GmbH.
Daniel enjoys solving challenging problems and is always keen on working with new
technologies, especially related to the fields of big data, functional programming,
optimization, and NoSQL databases.
More detailed information about his experience, as well as his contact details, can be
found at www.muehlbachler.org and www.linkedin.com/in/danielmuehlbachler.
© CHB Books
www.PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
Table of Contents
Preface vii
Chapter 1: Getting Started with Network Programming 1
Network addressing using the InetAddress class 3
NIO support 5
Using the URLConnection class 5
Using the URLConnection class with buffers and channels 6
The client/server architecture 7
Creating a simple echo server 8
Creating a simple echo client 10
Using Java 8 to support the echo server and client 12
UDP and multicasting 14
Creating a multicast server 14
Creating the multicast client 15
Scalability 17
Creating a threaded server 17
Using the threaded server 19
Security 21
Creating a SSL server 21
Creating an SSL client 22
Generating secure keys 23
Summary 25
Chapter 2: Network Addressing 27
Networking basics 27
Understanding network basics 29
Network architectures and protocols 30
Using the NetworkInterface class 32
Getting a MAC address 35
Getting a specific MAC address 35
[i]
© CHB Books
Table of Contents
[ ii ]
© CHB Books
Running the parts client/server
Table of Contents
76
Asynchronous socket channels 78
Creating the asynchronous server socket channel server 79
Creating the asynchronous socket channel client 81
Other buffer operations 83
Bulk data transfer 83
Using a view 85
Using read-only buffers 86
Controlling socket options 86
Summary 87
Chapter 4: Client/Server Development 89
The HTTP protocol structure 89
The nature of HTTP messages 91
Initial request line format 92
Header lines 94
Message body 94
Client/Server interaction example 95
Java socket support for HTTP client/server applications 95
Building a simple HTTP server 96
Building a simple HTTP client 100
Client/server development using standard Java classes 102
Using the HttpURLConnection class 102
URL encoding 105
Using the HTTPServer class 106
Implementing a simple HTTPServer class 108
Managing response headers 112
Open source Java HTTP servers 113
Server configuration 115
Handling cookies 116
Summary 117
Chapter 5: Peer-to-Peer Networks 119
P2P functions/characteristics 120
Applications-based P2P networks 122
Java support for P2P applications 123
Distributed hash tables 123
DHT components 124
DHT implementations 126
Using JDHT 126
Using FreePastry 128
The FreePastry demonstration 129
Understanding the FreePastryExample class 129
[ iii ]
© CHB Books
Table of Contents
[ iv ]
© CHB Books
The thread pool client/server in action
Table of Contents
185
Thread pool with Callable 186
Using a Callable 186
Using a Future 188
Using the HttpServer executor 189
Using a selector 190
Creating the selector 191
Registering a channel 191
Using the selector to support a time client/server 193
The channel time server 193
The date and time client application 197
The date and time server/client in action 197
Handling network timeouts 199
Summary 199
Chapter 8: Network Security 201
Security 201
Secure communication terminology 202
Encryption basics 203
Symmetric encryption techniques 204
Generating a key 204
Encrypting text using a symmetric key 205
Decrypting text 206
Asymmetric encryption techniques 206
Generating and saving asymmetric keys 208
Encrypting/decrypting text using an asymmetric key 209
Saving asymmetric keys to a file 210
Creating a keystore 213
Creating and maintaining a keystore with keytool 213
Keytool command-line arguments 216
Creating and maintaining a keystore with Java 219
Symmetric encryption client/server 221
Symmetric server application 222
Symmetric client application 224
Symmetric client/server in action 226
Asymmetric encryption client/server 227
Asymmetric server application 227
Asymmetric client application 228
Asymmetric client/server in action 230
TLS/SSL 230
SSL server 231
SSL client 233
SSL client/server in action 234
[v]
© CHB Books
Table of Contents
[ vi ]
© CHB Books
Preface
The world is becoming interconnected on an unprecedented scale with more services
being provided on the Internet. Applications ranging from business transactions
to embedded applications, such as those found in refrigerators, are connecting to
the Internet. With isolated applications no longer being the norm, it is becoming
increasingly important for applications to be network enabled.
The goal of this book is to provide the reader with the necessary skills to develop
Java applications that connect and work with other applications and services across
a network. You will be introduced to a wide range of networking options that
are available using Java, which will enable you to develop applications using the
appropriate technology for the task at hand.
Chapter 2, Network Addressing, explains how nodes on a network use addresses. How
Java represents these addresses is introduced along with support for IPv4 and IPv6.
This chapter also covers how Java can configure various network properties.
Chapter 3, NIO Support for Networking, explains how the NIO package provides
support for communication using buffers and channels. These techniques are
illustrated with a client/server application. The support that NIO provides for
asynchronous communication is also demonstrated.
[ vii ]
© CHB Books
Preface
Chapter 7, Network Scalability, explains how, as more demands are placed on a server,
systems need to scale to address these demands. Several threading techniques
supporting this need are demonstrated, including thread pools, futures, and the
NIO's selector.
[ viii ]
© CHB Books Preface
Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"The SSLSocketFactory class' getDefault returns an SSLSocketFactory instance
whose createSocket creates a socket that is connected to the secure echo server."
[ ix ]
Another Random Scribd Document
with Unrelated Content
“The Chemical Sense”
In the simpler multicellular organisms, which develop by cell
division and multiplication from a single cell, the cells differ from the
original type and from each other in position, structure, and
function. In the course of growth the organism originally spherical in
shape becomes modified by irregular growth of cells, producing folds
and prominences. Cells are crowded out of shape; some lie at the
base of a depression protected from stimulation; others occupy
positions which make them especially liable to be acted upon by
such stimuli. In the course of these modifications some of the cells
become especially adapted for receiving impressions, others for
conducting or transmitting these impressions to various parts of the
organism, others for producing movements of the organism. It is
with the first type of cell that we are concerned, the receptor
mechanisms. They are in the simpler organisms, adapted to receive
two sorts of stimulation, mechanical and chemical. In fact, through
the whole series of multicellular organisms such reactions to
mechanical and chemical stimuli have been noted more or less
definitely, although special sense organ structures have in many
cases not been discovered. This is especially true for the reactions to
chemical substances. It is customary to speak of the “chemical
sense,” to signify these responses to chemical substances, without
any attempt to differentiate between smell and taste. Obviously, in
the case of organisms which live in a fluid environment, this
chemical sense might be called taste, since it would correspond in a
way to that sense in man, for which the adequate stimulus is a fluid.
But since it is a “distance receptor,” in that objects at a distance can
produce responses, probably by diffusion of substances in the fluid,
it might also be looked upon as more nearly resembling the smell
sense. In most cases structure offers no help in settling the matter.
In the medusa, or jellyfish, one of the earliest forms in which a
nervous system and sense organs are found, the tentacles are
especially sensitive to chemical stimuli, much less so to mechanical
stimuli. To the former they respond by shortening and twisting
themselves about the object. As for sense organs in these parts,
there are small club-shaped papillæ in the neighborhood of the
tentacles, differing somewhat in character in the different species.
These papillæ contain a narrow canal lined with thick cylindrical
cells. As far as both structure and function are concerned, they may
be considered either as taste or smell organs.
In the flat worms, where a nervous system with a rudimentary
brain is found, the reaction to chemical stimulation is not clear. This
organism has specialized responses, among which is a movement
toward food placed near it. But whether this is a reaction to chemical
stimuli alone or combined with mechanical is not known. No taste
organs have been found. Pits or depressions found on the lateral
surface of the anterior end of the worm, and supplied with nerves
from the brain, have been regarded as olfactory rather than as taste
organs.
In the annelid group, of which the earthworm may be taken as an
example, there are well-defined chemical reactions, which more
nearly resemble taste reactions than the cases previously
mentioned. Here a positive reaction to food substances seems to
occur only when these substances come into contact with the body.
For instance, the characteristic burrowing reactions of the
earthworm are not aroused by placing filter paper soaked in manure
near them, but only when the paper is actually in contact with the
body. Negative reactions, however, to strong chemical stimulation
may take place without contact. Attempts have been made by Parker
and Metcalf to show specialized taste reactions to different chemical
substances by measuring the latent time in the responses to various
substances brought into contact with the body. From such evidence
as this it would appear that earthworms have specialized reactions
to the chlorides of sodium, potassium, lithium, and ammonium,
which are indistinguishable to the human taste sense, with their
common salt taste. These results are interpreted as indicating
qualitatively different effects of the stimuli. In these organisms it has
been possible to discover taste organs, distinct from the olfactory
organs. They are described as cup-shaped organs, which may be
either depressions or prominences. They occur in large numbers and
are widely scattered over the body. They are said, however, to be
especially numerous at the edges of the mouth and within the
mouth cavity.
The crustacea, among which are the crabs and the lobsters,
characterized by their hard shell-like covering, show certain specific
reactions to chemical substances when these come into contact with
the parts of the body near the mouth. Reactions to chemical stimuli
applied to any part of the body of the crayfish have been reported
by Bell. The positive reactions were such as to bring the substance
toward the mouth and the negative reactions such as to remove the
substance. Responses to such substances at a distance are
uncertain. But it is difficult to differentiate between possible smell
and taste reactions. The sense organs in these organisms are usually
located upon the antennæ, or feelers, in the neighborhood of the
mouth. Here there is a different kind of response to chemical and
mechanical stimulation. No structures with a specific taste function
have been described, although smell and tactile organs have been
localized.
In the organisms described above, the chemical, or, more
specifically, the taste, sense is a food sense,—edible and inedible
substances causing reactions of different character. The reactions to
stimuli within the edible group, however, show no variation. In the
insects, especially the ants, bees, wasps, etc., there seem to be
qualitative differences in the effect produced by chemical
substances. It is by means of this chemical sense that bees and ants
are able to find food at a distance, to return to their homes under all
sorts of adverse conditions, and to distinguish nest mates from
enemy intruders. But, since these are all reactions to stimuli at a
distance, they must be attributed to the smell sense, rather than to
the taste sense. But in the case of these organisms a sharp
distinction between smell and taste seems possible. Forel and others
have offered honey mixed with strychnine to ants, who seized it
greedily, indicating an olfactory sensibility. But immediately after the
honey had touched the mouth parts, avoiding reactions, such as to
remove the substance, followed, indicating sensitiveness to the bitter
substance. Wasps and bees will make the same sort of responses if
distasteful substances which are inodorous are mixed with pleasant,
odorous substances. The sensitivity to tastes varies considerably in
different insects, being very great in bees and ants. From such
experiments as the above it has been concluded that the smell
organs are located on the antennæ and that the taste organs are
located on the lips and in the mouth. Microscopical examination
shows that in all insects the tongue and inside of the mouth are
covered with minute pits, or depressions. In each pit there is a
minute hair, or rod. Some observers say that this rod is hollow and
perforated at the end, thus communicating with the nerve which
ends at its base. Other observers say that there is no perforation
upon the end of the hair. However this may be, there seems to be
no doubt that these are the taste organs. The same type of structure
has been reported on the proboscis of the bumblebee, the hive bee,
and the common fly. They are said to resemble a hollow hair, the
channel communicating with a nerve fiber at its base. In the insects,
then, we find the earliest definitely specialized taste mechanism.
Chemical Sense in Fishes
In the fishes, again, the distinction between the senses of smell
and taste becomes more difficult, on account of their fluid
environment. But, disregarding the distinction between smell and
taste, the general chemical sense plays a very important part in the
life of the fish. Now, some observers have included all of this
sensitivity to chemical substances within the sense of smell, while
others have attributed a part of it to a taste mechanism. As
representative of the latter, Herrick’s conclusions are of interest: “In
fishes the gustatory system is much more extensively developed
than in mammals, especially the vagal part which supplies the taste
buds in the gill region. In some species of fishes, moreover, taste
buds appear in great numbers on the outer skin, and these are in all
cases innervated from the seventh cranial nerve. In the common
horned-pouts, or catfishes, and in the carps and suckers these
cutaneous taste buds are distributed over practically the entire body
surface, and especially on the barblets.... These sense organs and
their nerves are entirely independent of those of the lateral line
system, and of the ordinary tactual system, though the gustatory
and tactual systems have been shown experimentally to coöperate in
the selection of food.”
Herrick determined by experiment that the sense organs thus
generally distributed over the body of the catfish really had a taste
function. Food placed at a distance from the fish produces only
restless movements, indicating that the eyes do not direct them to it.
But if food comes into contact with the mouth parts, or, in fact, any
part of the body, it is immediately seized. To show that this reaction
is not alone due to tactual stimulation, the tactual organs were first
stimulated with cotton wool, which produced the characteristic
seizing reaction. But after stimulation was continued for a while
reaction no longer followed. If at this point the cotton wool be
soaked with meat juice, the seizing reaction is again set up.
Adaptation to tactual stimulation has taken place, leaving the taste
organs to function alone. To show further that the responses did not
depend on olfactory stimulation, the olfactory nerves of certain
fishes were cut. When the experiment was performed, after recovery
from the operation the responses were the same as in normal fish.
The experiments of Parker show further that the mouth and
external surface of the body of certain fishes are sensitive to sour,
salt, and alkaline solutions. Sheldon obtained about the same
results. The external skin covering is not sensitive to sugars. The
tongue of fishes presents a smooth, gray, dorsal surface, devoid of
elevations or papillæ, which characterize the tongues of many other
organisms. Nor is it a mobile organ in comparison with other
species. On the whole, the tongue itself seems little adapted for
arousing taste sensations.
The system of “lateral line” organs of fishes have at times been
thought to be concerned with the chemical sense. This is probably
not the case, although their exact function is a question still under
dispute.
In a general way, the taste buds, or sense organs of taste of
fishes, resemble those of the human being. They are either flask- or
cup-shaped, and are composed of two types of cells, called
supporting cells and taste cells. The latter cells end peripherally in a
hair or bristle, just as the same kind of cell in the human taste bud.
Land-Dwelling Animals
There seems to be no experimental evidence for a specific sense
of taste in amphibia, or reptiles. But sense organ structures have
been described upon the tongue and soft palate of the frog, where
they are said to occur in hundreds. They are disc-shaped structures,
made up of several kinds of cells, which correspond to the real taste
cells and supporting cells of the human sense organ. The taste cells
end peripherally in several hairs or bristles, and at their central end
make connection with nerve fibers. In the reptile group there is
neither experimental evidence of taste sensitivity nor anatomical
evidence of the presence of taste corpuscles on the tongue or in the
mouth cavity.
The experimental evidence for the taste sense in birds is slight. It
certainly is greatly overshadowed by the keen senses of sight and
hearing. Birds seem to represent one case, however, in which taste
is more important than smell. Taste sensitivity for different chemical
substances, in the case of young chickens, at least, seems clear from
certain studies of instinct and learning, in which they accept certain
kinds of food and reject others after tasting them. In considering the
sense of taste in birds it must be remembered that most of them
swallow their food without chewing it or without having it reduced to
liquid form through mixture with saliva. The tongue, which varies in
character considerably in different types of birds, is in most cases
covered with a horny coat. Numerous hard papillæ are found upon
its surface. Microscopical examination of these papillæ shows
nothing which can correspond to taste buds or to gustatory cells.
The parrot is said to form an exception to most birds, in that it has a
relatively soft and fleshy tongue, with numerous papillæ, and also in
that it chews its food.
In the duck, which has a large tongue, there are certain portions
which lack the hard covering common to birds’ tongues. Here, in
addition to a large number of tactile corpuscles, there are groups of
cells which resemble somewhat true taste corpuscles. The peripheral
ends of their cells reach the surface of the mucous covering of the
tongue. The cells do not end in the bristle, or hair-like, formation, as
those of the human taste cells, but in a pointed elongation of the
protoplasm. Experimental evidence of the function of these
structures is lacking.
Taste sensitivity and the structure of the taste organs differ greatly
in the mammals, but there seem to be two characteristics in
common, namely, the localization of the taste corpuscles within the
mouth and the importance of the tongue in arousing taste
sensations. The character of the mucous lining of the mouth also
shows great variation in the number of papillæ and the taste buds
which they contain. The number of papillæ varies from two or three
in the marsupials and four in the elephant to an extremely large
number in rodents, e.g., the rat. The papillæ are in general quite
similar to the three most common forms in the human taste organs,
the circumvallate, the fungiform, and the filiform, and have about
the same location in relation to each other. The greatest difference is
in the prominence of the fourth type, the foliate papillæ in certain
mammals, as compared with man. These are seen best in the rabbit,
as folds directed downward and forward on the sides of the tongue
in its posterior portion. They have been considered to result from the
great number of papillæ which throw the mucus into folds. Each
foliate papilla is composed of a number of parallel ridges, each ridge
in turn being composed of papillæ of the fungiform type. Between
the ridges there are narrow ditches. It is in the side walls of these
that the taste corpuscles are found in greatest numbers. Thus, these
ditches are analogous, in function at least, to those of the
circumvallate papillæ. Their origin, however, seems to be different
from that of the circumvallate. In the monkey one finds less
prominent folds on the sides of the tongue, rich in taste corpuscles,
which represent the foliate papillæ.
The taste corpuscles themselves have about the same
characteristics in all mammals as in man. There are differences in
size, to be sure, but their structure is the same, and the supporting
cells, gustatory cells, and nerve fibers are present in them all.
This survey of taste in the animal kingdom suggests the
conclusion that the taste organs represent a modification of the
original skin sensitivity or touch sense, and surely a slight
modification when compared with the senses of sight and hearing. A
certain resemblance has been remarked by Wundt and others
between the touch corpuscles and the gustatory corpuscles. His
interpretation is that the whole body was originally endowed with
the touch sense, while certain parts being affected continually by
specific sorts of stimuli, became adapted to them by undergoing
modifications of structure. The head or mouth end of the animal was
more subject to chemical stimulation, and the adaptation of the
tactile organs to this particular form of stimulation resulted in the
development of the senses of taste and smell. To consider taste as
one of the lower senses, in the sense of being least highly developed
and the earliest to appear, is justified from this survey of the
evolution of the taste sense, if from no other point of view.
CHAPTER XI
Vision 57%
Hearing 20%
Smell 6%
Taste 6%
Touch 4%
Movement 3%
Temperature 2%
Organic 1%
Emotional 1%
Disorders of taste are for the most part neither as varied nor as
bizarre as the abnormal conditions of the more complex senses.
Illusions of taste, hallucinations, and subjective tastes we have
already referred to as frequently found. But of them little can be
said, except that they occur, and that they present very little of
psychological interest. The appearance of these subjective tastes
may in some cases be due merely to the fact that “a taste sensation
easily associates itself with certain muscular sensations. Thus,
pressure on the base of the tongue provokes the movements of
vomiting. With this muscular sensation may be associated a
sensation of bitter, which accompanies violent nausea.” In ways
similar to this some observers would explain the reports of others
who find taste sensations to be produced by mechanical stimulation
of papillæ. Most observers do not get such results, and it may be
that these sensations when they are reported are of the associated
variety.
In the case of certain abnormal nervous conditions, however,
these features may assume rather striking proportions. Thus, in the
“auræ,” or preliminary symptoms preceding an epileptic attack, the
patient often experiences unpleasant bitter or metallic tastes, and
distressing feelings of numbness of tongue, etc. These sensory
manifestations are, however, by no means as elaborate as are the
“auræ” of some of the other senses, notably hearing and vision.
Partial and Complete Ageusia
Conditions of partial or complete ageusia, or loss of taste, are well
known. Such conditions may result from the local application of
various drugs to the end organs, the paralyzing effect of drugs on
the nerve trunks, injury to, or operations on, these nerves, or
damage through injury, disintegration, or removal of special brain
areas.
Taste Hallucinations of the Insane
In the case of the mentally deranged taste hallucinations are
usually disagreeable, and they are often rationalized into a fabric of
delusions,—foul gases are said to be blown upon them, poisons are
being placed in their food. Such patients behave in realistic manner,
making various defensive reactions, such as stuffing the nostrils with
paper or cloth, spitting, and refusing food. In some cases these
hallucinations of the insane obviously originate from local
inflammation in the peripheral tissues, or from glandular
disturbances, and, hence, do not in themselves constitute important
pathological symptoms. In some cases, however, such hallucinations
arise quite independently of such acute local conditions of irritation,
as in chronic psychic disorders or dementias. Under such
circumstances they have greater significance, as they point to more
deep-seated mental and nervous disturbance. Just as in normal life
taste and smell are very closely associated with each other, so, in
these cases of insane hallucinations, disorders of taste sensation are
likely to involve olfactory irregularities as well.
Synæsthesias of Taste
An interesting though apparently somewhat rare phenomenon in
the field of sensation is what is known as “synæsthesia.” By this is
meant cases in which a given sense quality arouses, or is intimately
associated with, qualities belonging to other sensory modes. Thus, in
the case of vision and hearing, some individuals perceive the
different vowel sounds, or the sound of musical instruments, as
having color. One such person reports that to him all the consonant
sounds seem to be very dark purple, while among the vowel sounds
“a” seems yellow, “e” is pale emerald, and “u” is light dove color.
Taste, far from being an exception in this case, is one of the
senses in connection with which “synæsthesias” must often occur.
Salt, for instance, is described by one observer as dull red, bitter as
brownish, sweet as clear bright red, and sour as green or greenish-
blue. To another observer the taste of meats seems red or brown,
the taste of Graham bread is rich red in color, while all ice creams
(except chocolate and coffee) taste blue. To still another reporter the
sound of the word “intelligence” tastes like fresh sliced tomatoes,
while the sound of the word “interest” tastes like stewed tomatoes.
There has been much speculation as to the probable meaning and
mechanism of these synæsthetic experiences. Investigation seems
to show that the particular combinations are by no means universal,
even among those who report such observations,—they seem to be
individual and personal in their nature and presumably in their
origin.
It seems quite probable that in the main these synæsthesias
represent uncritical confusion of sensory qualities with other sensory
qualities, or with the affective qualities, the feelings, which
accompany them. Thus, we often hear such phrases as “bright
taste,” “heavy taste,” “dark brown taste,” “green taste,” “soft taste,”
“hard taste,” “smooth taste,” etc. It is clear in most of these cases
that either a touch component is included in the total taste
experience (as in “smooth taste,” “soft taste,” “hard taste”), or that
kinæsthetic (muscular) factors are so included (as in “heavy taste”),
or that the phrase is more or less designedly an analogy, or other
figure of speech (as in “sharp taste,” “bright taste,” “clear taste”).
The basis of such analogies is sometimes rather easily discerned,
and often is seen to be the “feeling tone” which the sensation
arouses,—the effect or “affect” which it produces. Thus, a heavy
weight retards, inhibits, and overpowers us. Some tastes have this
same overpowering affective tone, and may be intelligibly described
as “heavy.” A clear, bright day gives us recognizable feelings of
pleasantness, relief, and gives to objects a distinctness of contour.
Some tastes, being well defined, definitely localized, and highly
agreeable and soothing, may, then, be intelligibly described as being
“clear,” “bright,” or “pointed.” These illustrations represent, to be
sure, only simple forms of such synæsthesias. But even the
resemblance of the sound of “intelligence” to the taste of fresh sliced
tomatoes is by no means incomprehensible when we reflect that
“freshness” means “alertness,” “sliced” suggests sharpness of edge,
while tomatoes thus prepared are usually mature and ripe. For are
not alertness, keenness, and maturity the very marks of intelligence,
just as “dullness” and “greenness,” also sense qualities, are
expressive of its absence? In somewhat the same way we commonly
speak of “sweet odors,” “sweet sounds of music,” or even sweet
visual experiences, as in “a sweet face.”
A few individual cases of taste synæsthesia have been studied in
some detail. Such individuals are often shown to have a defective
sense of taste and to rely largely, in their recognition of taste, on
touch accompaniments, affective characteristics, and such “color”
experiences as the various tastes are said to induce.
Perversions of Taste
Under certain unusual organic conditions, and also still more
commonly in the case of degenerate and neurotic individuals,
various perversions of taste occur. These perversions do not seem to
be exclusively gustatory in character, since they involve more general
factors, such as appetite, craving, and emotional disturbance. The
name parorexia is sometimes given to these perversions of taste and
appetite. One of the subforms, known as malacia, takes the form of
an urgent desire for hot spices, or for sour and acid foods, such as
pickles. What is known as “salt hunger” is a very similar condition,
especially often found among the lower animals. Another form of
such perversion, known as pica, shows itself in the desire to eat
such substances as clay, chalk, and similar gritty or earthy
substances. Especially often among children and among certain
primitive peoples the chewing of these substances often seems to
give a satisfaction quite unfamiliar to the majority of mankind. Little
is known about such perversions beyond the fact that they have
often been reported.
Under certain conditions of mental degeneracy and nervous
disorder perversions sometimes arise which have been classed under
the term allotriophagia. This perversion takes the form of eating with
apparent relish various kinds of filth which are commonly offensive
and disgusting. In these cases it is quite possible that there is no
genuine taste disorder. Many, if, indeed, not most, of our revulsions
against substances known as filth arise on the basis of associated
circumstances, rather than on the simple basis of their taste
qualities. The falling away, or deterioration, of these associative and
æsthetic controls in the case of the demented and degenerate, and
their absence in the case of the feeble-minded and imbecile, may
easily lead to reactions which suggest but do not necessarily involve
genuine taste disorder.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com