(Ebook) Network Programming with Go Language: Essential Skills for Programming, Using and Securing Networks with Open Source Google Golang by Jan Newmarch; Ronald Petty ISBN 9781484280959, 1484280954, 3443df7b-2f04-4ebe-a800-9d03e53b0c8c, 3443DF7B-2F04-4EBE-A800-9D03E53B0C8C 2024 scribd download
(Ebook) Network Programming with Go Language: Essential Skills for Programming, Using and Securing Networks with Open Source Google Golang by Jan Newmarch; Ronald Petty ISBN 9781484280959, 1484280954, 3443df7b-2f04-4ebe-a800-9d03e53b0c8c, 3443DF7B-2F04-4EBE-A800-9D03E53B0C8C 2024 scribd download
com
OR CLICK HERE
DOWLOAD EBOOK
ebooknice.com
https://ebooknice.com/product/network-programming-with-go-
language-43675912
ebooknice.com
ebooknice.com
(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena
Alfredsson, Hans Heikne, Sanna Bodemyr ISBN 9789127456600,
9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
ebooknice.com
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
ebooknice.com
ebooknice.com
ebooknice.com
Jan Newmarch and Ronald Petty
Network Programming with Go
Language
Essential Skills for Programming, Using and
Securing Networks with Open Source Google
Golang
2nd ed.
Dr. Jan Newmarch
Oakleigh, VIC, Australia
Ronald Petty
San Francisco, CA, USA
The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress
Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
I dedicate this to my family.
Preface to the Second Edition
While an age has passed in Internet years, Go remains a primary
destination for programmers. Go conquered the container technology
space. It continues to find affection in Cloud Native development. Go
strives to remain true to itself, backward compatible, yet adding new
language features like Generics. Tooling improvements such as Fuzzing
allow for more secure application development.
Go has changed, and so has this book. The first edition used Go 1.8;
we are now on Go 1.18. The code has been updated to reflect this new
reality. The examples have been largely developed to show a particular
feature of Go networking without forcing complexity like managing
several projects or packages scattered across the book; the associated
repository can be found here
https://github.com/Apress/network-prog-with-go-2e.
The first version of this book assumed familiarity with Go, and that
remains in this edition. We expand slightly what we are willing to
discuss in this book with the inclusion of more third-party modules,
tools, and techniques. Jan was correct to keep the focus on Go and not
to be distracted with the ecosystem at large.
If you desire to learn about implementing networking concepts with
Go, I hope this book serves you well.
As a point of comparison, what follows is Jan’s original preface,
reflecting Go in 2017.
Preface to the First Edition
It’s always fun to learn a new programming language, especially when it
turns out to be a major one. Prior to the release of Go in 2009, I was
teaching a Master’s level subject in network programming at Monash
University. It’s good to have a goal when learning a new language, but
this time, instead of building yet another wine cellar program, I decided
to orient my lecture notes around Go instead of my (then) standard
delivery vehicle of Java.
The experiment worked well: apart from the richness of the Java
libraries that Go was yet to match, all the programming examples
transferred remarkably well, and in many cases were more elegant than
the original Java programs.
This book is the result. I have updated it as Go has evolved and as
new technologies such as HTTP/2 have arisen. But if it reads like a
textbook, well, that is because it is one. There is a large body of
theoretical and practical concepts involved in network programming
and this book covers some of these as well as the practicalities of
building systems in Go.
In terms of language popularity, Go is clearly rising. It has climbed
to 16th in the TIOBE index, is 18th in the PYPL (Popularity of
Programming Language), and is 15th in the RedMonk Programming
Language rankings. It is generally rated as one of the fastest growing
languages.
There is a growing community of developers both of the core
language and libraries and of the independent projects. I have tried to
limit the scope of this book to the standard libraries only and to the
“sub-repositories” of the Go tree. While this eliminates many excellent
projects that no doubt make many programming tasks easier,
restricting the book to the official Go libraries provides a clear bound.
This book assumes a basic knowledge of Go. The focus is on using
Go to build network applications, not on the basics of the language.
Network applications are different than command-line applications, are
different than applications with a graphical user interface, and so on. So
the first chapter discusses architectural aspects of network programs.
The second chapter is an overview of the features of Go that we use in
this book. The third chapter on sockets covers the Go version of the
basics underlying all TCP/IP systems. Chapters 4, 5, and 6 are more
unusual in network programming books. They cover the topics of what
representations of data will be used, how a network interaction will
proceed, and for text, which language formats are used. Then in Chapter
7, we look at the increasingly important topic of security. In Chapter 8,
we look at one of the most common application layer protocols in use,
HTTP. The next four chapters are about topics related to HTTP and
common data formats carried above HTTP – HTML and XML. In
Chapter 13, we look at an alternative approach to network
programming, remote procedure calls. Chapters 14 and 15 consider
further aspects of network programming using HTTP.
Any source code or other supplementary material referenced by the
author in this book is available to readers on GitHub. For more detailed
information, please visit
https://github.com/Apress/network-prog-with-go-2e.
Acknowledgments
I want to share my appreciation for Jan Newmarch for collaborating on
this book. This project has offered me a tremendous sense of
achievement and allowed me to cross a much-anticipated item off my
bucket list. I would also like to thank Eldon Alameda for his thoughtful
approach at letting me know when I am off the mark and for providing
me with solid advice.
Additionally, I owe gratitude to my partners at Apress, both Steve
Anglin for the opportunity and Mark Powers for the guidance to help
see this through. Thank you to my colleagues at RX-M, including Randy
Abernethy, Christopher Hanson, Andrew Bassett, and Anita Wu. Our
work over the years has allowed for my participation in a project such
as this book.
Finally, I want to thank my wife Julie and daughter Charlotte. Julie’s
capacity to manage the world while I hide out on a computer is
unmatched and most appreciated. Charlotte’s energy, abilities, and
creativity inspire me to become better every day.
—Ronald Petty
Table of Contents
Chapter 1:Architectural Layers
Protocol Layers
ISO OSI Protocol
OSI Layers
TCP/IP Protocol
Some Alternative Protocols
Networking
Gateways
Host-Level Networking
Packet Encapsulation
Connection Models
Connection Oriented
Connectionless
Communications Models
Message Passing
Remote Procedure Call
Distributed Computing Models
Client-Server System
Client-Server Application
Server Distribution
Communication Flows
Synchronous Communication
Asynchronous Communication
Streaming Communication
Publish/Subscribe
Component Distribution
Gartner Classification
Three-Tier Models
Fat vs.Thin
Middleware Model
Middleware Examples
Middleware Functions
Continuum of Processing
Points of Failure
Acceptance Factors
Thoughts on Distributed Computing
Transparency
Access Transparency
Location Transparency
Migration Transparency
Replication Transparency
Concurrency Transparency
Scalability Transparency
Performance Transparency
Failure Transparency
Eight Fallacies of Distributed Computing
Fallacy: The Network Is Reliable
Fallacy: Latency Is Zero
Fallacy: Bandwidth Is Infinite
Fallacy: The Network Is Secure
Fallacy: Topology Doesn’t Change
Fallacy: There Is One Administrator
Fallacy: Transport Cost Is Zero
Fallacy: The Network Is Homogeneous
Conclusion
Chapter 2:Overview of the Go Language
Types
Slices and Arrays
Maps
Pointers
Functions
Structures
Methods
Multithreading
Packages
Modules
Type Conversion
Statements
GOPATH
Running Go Programs
Standard Libraries
Error Values
Conclusion
Chapter 3:Socket-Level Programming
The TCP/IP Stack
IP Datagrams
UDP
TCP
Internet Addresses
IPv4 Addresses
IPv6 Addresses
IP Address Type
Using Available Documentation and Examples
The IPMask Type
Basic Routing
The IPAddr Type
Host Canonical Name and Addresses Lookup
Services
Ports
The TCPAddr Type
TCP Sockets
TCP Client
A Daytime Server
Multithreaded Server
Controlling TCP Connections
Timeout
Staying Alive
UDP Datagrams
Server Listening on Multiple Sockets
The Conn, PacketConn, and Listener Types
Raw Sockets and the IPConn Type
Conclusion
Chapter 4:Data Serialization
Structured Data
Mutual Agreement
Self-Describing Data
Encoding Packages
ASN.1
ASN.1 Daytime Client and Server
JSON
A Client and A Server
The Gob Package
A Client and A Server
Encoding Binary Data As Strings
Protocol Buffers
Installing and Compiling Protocol Buffers
The Generated personv3.pb.go File
Using the Generated Code
Conclusion
Chapter 5:Application-Level Protocols
Protocol Design
Why Should You Worry?
Version Control
The Web
Message Format
Data Format
Byte Format
Character Format
A Simple Example
A Stand-Alone Application
The Client-Server Application
The Client Side
Alternative Presentation Aspects
The Server Side
Protocol:Informal
Text Protocol
Server Code
Client Code
Textproto Package
State Information
Application State Transition Diagram
Client-State Transition Diagrams
Server-State Transition Diagrams
Server Pseudocode
Conclusion
Chapter 6:Managing Character Sets and Encodings
Definitions
Character
Character Repertoire/Character Set
Character Code
Character Encoding
Transport Encoding
ASCII
ISO 8859
Unicode
UTF-8, Go, and Runes
UTF-8 Client and Server
ASCII Client and Server
UTF-16 and Go
Little-Endian and Big-Endian
UTF-16 Client and Server
Unicode Gotchas
ISO 8859 and Go
Other Character Sets and Go
Conclusion
Chapter 7:Security
ISO Security Architecture
Functions and Levels
Mechanisms
Data Integrity
Symmetric Key Encryption
Public Key Encryption
X.509 Certificates
TLS
A Basic Client
Server Using a Self-Signed Certificate
Conclusion
Chapter 8:HTTP
URLs and Resources
i18n
HTTP Characteristics
Versions
HTTP/0.9
HTTP/1.0
HTTP 1.1
HTTP Major Upgrades
HTTP/2
HTTP/3
Simple User Agents
The Response Type
The HEAD Method
The GET Method
Configuring HTTP Requests
The Client Object
Proxy Handling
Simple Proxy
Authenticating Proxy
HTTPS Connections by Clients
Servers
File Server
Handler Functions
Bypassing the Default Multiplexer
HTTPS
Conclusion
Chapter 9:Templates
Inserting Object Values
Using Templates
Pipelines
Defining Functions
Variables
Conditional Statements
The html/template Package
Conclusion
Chapter 10:A Complete Web Server
Browser Site Diagram
Browser Files
Basic Server
The listFlashCards Function
The manageFlashCardsFunction
The Chinese Dictionary
The Dictionary Type
Flashcard Sets
Fixing Accents
The ListWords Function
The showFlashCards Function
Presentation on the Browser
Running the Server
Conclusion
Chapter 11:HTML
The html/template Package
Tokenizing HTML
XHTML/HTML
JSON
Conclusion
Chapter 12:XML
Unmarshalling XML
Marshalling XML
Parsing XML
The StartElement Type
The EndElement Type
The CharData Type
The Comment Type
The ProcInst Type
The Directive Type
XHTML
HTML
Conclusion
Chapter 13:Remote Procedure Call
Go’s RPC
HTTP RPC Server
HTTP RPC Client
TCP RPC Server
TCP RPC Client
Matching Values
JSON
JSON RPC Server
JSON RPC Client
Conclusion
Chapter 14:REST
URIs and Resources
Representations
REST Verbs
The GET Verb
The PUT Verb
The DELETE Verb
The POST Verb
No Maintained State (That Is, Stateless)
HATEOAS
Representing Links
Transactions with REST
The Richardson Maturity Model
Flashcards Revisited
URLs
ServeMux (The Demultiplexer)
Content Negotiation
GET /
POST /
Handling Other URLs
The Complete Server
Client
Using REST or RPC
Conclusion
Chapter 15:WebSockets
WebSockets Server
The golang.org/x/net/websocket Package
The Message Object
The JSON Object
The Codec Type
WebSockets over TLS
WebSockets in an HTML Page
The github.com/gorilla/websocket Package
Echo Server
Echo Client
Conclusion
Chapter 16:Gorilla
Middleware Pattern
Standard Library ServeMux Examples
Customizing Muxes
gorilla/mux
Why Should We Care
Gorilla Handlers
Additional Gorilla Examples
gorilla/rpc
gorilla/schema
gorilla/securecookie
Conclusion
Chapter 17:Testing
Simple and Broken
httptest Package
Below HTTP
Leveraging the Standard Library
Conclusion
Appendix A:Fuzzing
Fuzzing in Go
Fuzzing Failures
Conclusion
Appendix B:Generics
A Filtering Function Without Generics
Refactor Using Generics
Custom Constraints
Using Generics on Collections
How Not to Use Generics?
Conclusion
Index
About the Authors
Jan Newmarch
was head of ICT (higher education) at
Box Hill Institute before retiring, and still
is adjunct professor at Canberra
University, and adjunct lecturer in the
School of Information Technology,
Computing and Mathematics at Charles
Sturt University. He is interested in more
aspects of computing than he has time to
pursue, but the major thrust over the last
few years has developed from user
interfaces under UNIX into Java, the Web,
and then into general distributed
systems. Jan developed a number of
publicly available software systems in these areas. For the last few
years, he had been looking at sound for Linux systems and
programming the Raspberry Pi’s GPU. He is now exploring aspects of
the IoT and Cyber Security. He lives in Melbourne, Australia, and enjoys
the food and culture there, but is not so impressed by the weather.
OSI Layers
The function of each layer from bottom to top is as follows:
The Physical layer conveys the bit stream using electrical, optical, or
radio technologies.
The Data Link layer puts the information packets into network
frames for transmission across the Physical layer and back into
information packets.
The Network layer provides switching and routing technologies.
The Transport layer provides transparent transfer of data between
end systems and is responsible for end-to-end error recovery and
flow control.
The Session layer establishes, manages, and terminates connections
between applications.
The Presentation layer provides independence from differences in
data representation (e.g., encryption).
The Application layer supports application and end-user processes.
A layer in the OSI model often maps to a modern protocol; for
example, the IP from TCP/IP maps to the Network layer, also known as
layer 3 (Physical is layer 1). The Application layer, layer 7, maps to
HTTP. Some protocols like HTTPS seem to blend layers, 5 (Session) and
6 (Presentation). No model is perfect; alternatives exist to the OSI
model that maps closer to a given reality, such as the TCP/IP protocol
model.
TCP/IP Protocol
While the OSI model was being argued, debated, partly implemented,
and fought over, the DARPA Internet research project was busy building
the TCP/IP protocols. These have been immensely successful and have
led to The Internet (with capitals). This is a much simpler stack, as
shown in Figure 1-2.
Connection Oriented
A single connection is established for the session. Two-way
communications flow along the connection. When the session is over,
the connection is broken. The analogy is to a phone conversation. An
example is TCP.
Connectionless
In a connectionless system, messages are sent independent of each
other. Ordinary mail is the analogy. Connectionless messages may
arrive out of order. Messages do not have an impact on each other. An
example is the IP protocol. UDP is a connectionless protocol above IP
and is often used as an alternative to TCP, as it is much lighter weight.
Connectionless is also known as unconnected or stateless.
Connection-oriented transports may be established on top of
connectionless ones – TCP over IP. Connectionless transports may be
established on top of connection-oriented ones – HTTP over TCP.
Messages over a connection-oriented transport protocol have some
kind of relation, for example, a sequence number used to keep order.
Having state allows for functionality and optimizations; it also has an
associated cost of storage and computing.
There can be variations on these. For example, a session might
enforce messages arriving but might not guarantee that they arrive in
the order sent. However, these two are the most common.
Connection models are not the only way a protocol can vary. One
often desired feature is reliability; this is where the protocol has logic to
fix some types of errors; for example, TCP resends a missing packet. It’s
pretty common to assume connection-oriented protocols are reliable;
this is not always the case (e.g., MPLS). Additional features of a network
protocol could include message boundary management, delivery
ordering, error checking, flow control, etc. These features can exist in
one protocol layer and not another, partly why there are so many
network protocol stacks.
Sometimes, these features are reworked throughout the protocol
stack. An example of this kind of feature rework is with HTTP/3. In
HTTP/2, reliability is provided using TCP at layer 4. In HTTP/3, TCP is
being replaced with UDP, which is not reliable. Instead, reliability will
be provided with another protocol known as QUIC. While QUIC is
considered a Transport layer, like TCP or UDP, it works on top of UDP.
As you can see, the layer model is not an exact science.
Communications Models
In a distributed system, there will be many components (i.e., processes)
running that have to communicate with each other. There are two
primary models for this, message passing and remote procedure calls.
In the context of networking, these models allow interprocess (and/or
thread) communication with intent to invoke behavior on the remote
process.
Message Passing
Some languages are built on the principle of message passing.
Concurrent languages (and tools) often use such a mechanism, and the
most well-known example is probably the UNIX pipeline. The UNIX
pipeline is a pipeline of bytes, but this is not an inherent limitation:
Microsoft’s PowerShell can send objects along its pipelines, and
concurrent languages such as Parlog can send arbitrary logic data
structures in messages between concurrent processes. Recent
languages such as Go have mechanisms for message passing (between
threads).
Message passing is a primitive mechanism for distributed systems.
Set up a connection and pump some data down it. At the other end,
figure out what the message was and respond to it, possibly sending
messages back. This is illustrated in Figure 1-4.
Figure 1-4 The message passing communications model
Event-driven systems act in a similar manner. At a low level, the
programming language node.js runs an event loop waiting for I/O
events, dispatching handlers for these events and responding. At a
higher level, most user interface systems use an event loop waiting for
user input, while in the networking world, Ajax uses the
XMLHttpRequest to send and receive requests.
Die Manie ist in ihren Grundzügen das gerade Gegentheil von der
Melancholie. Statt der die letztere charakterisirenden Depression des
Gemüthes und der daraus sich ergebenden traurigen, peinlichen
Affecte finden wir bei der Manie eine äusserlich unmotivirte heitere
Stimmung, statt der Hemmung der psychischen Thätigkeit das
Gefühl einer gewissen Leichtigkeit und Ungebundenheit derselben
mit consecutiven Wonnegefühlen und statt der nur durch peinliche
Affecte höchsten Grades zu überwindenden psychomotorischen
Lähmung einen auffallenden, durch erhöhtes Kraft- (Muskel-) Gefühl
bedingten Bewegungsdrang, der schliesslich in Tobsucht ausartet.
Man kann die einfache maniakalische Exaltation von der Manie
auf der Höhe ihrer Entwicklung oder der Tobsucht unterscheiden.
Die m a n i a k a l i s c h e E x a l t a t i o n kann längere Zeit für sich
bestehen und auch ablaufen, ohne in eigentliche Tobsucht
überzugehen. Ihrem Auftreten geht in der Regel ein melancholisches
Stadium voraus, welches sich durch entsprechende
Charakterveränderung kundgibt und daher in diagnostischer
Beziehung werthvoll ist. Die Erscheinungen in den ersten Stadien der
maniakischen Exaltation haben eine grosse Aehnlichkeit mit jenen,
wie wir sie, allerdings vorübergehend, im Anfange von
Rauschzuständen beobachten: die Stimmung wird eine heitere,
aufgewecktere, die Vorstellungsthätigkeit ist erleichtert, der Kranke
spricht viel und rasch, die Triebe sind erhöht und in Folge des
gesteigerten Muskelgefühles besteht ein erhöhter Bewegungsdrang.
Dieses Verhalten ruft nicht blos beim Kranken ein Wohlbehagen
hervor, das ihn veranlasst, seinen Zustand zu loben und sich für
gesünder als je zu halten, sondern kann auch bei der Umgebung den
Eindruck voller geistiger Gesundheit hervorrufen oder es wird die
erhöhte Lebhaftigkeit des Kranken als Alkoholwirkung aufgefasst,
umsomehr, als die heitere Verstimmung das Individuum thatsächlich
zum Alkoholgenusse verleitet, andererseits eine gewisse Intoleranz
gegen Alcoholica besteht und schon geringe Mengen der letzteren
das bereits kranke Gehirn zu afficiren vermögen. Im weiteren
Verlaufe wird die Stimmung immer exaltirter, aufgeregter, die
Verletzungen der Rücksichten der Convenienz und des Anstandes
werden immer auffälliger, die Reizbarkeit und Geneigtheit zu
Affecten, insbesondere des Zornes, nimmt zu, die anfangs
erleichterte Vorstellungsthätigkeit erhält in Folge des Wegfalles
jeglicher Hemmung immer mehr den Charakter des Ueberstürzten
und gestaltet sich schliesslich zur förmlichen Ideenflucht, die
motorische Aufregung wird immer auffälliger, sich durch Unruhe,
Wandertrieb, scheinbar muthwillige Handlungen und Drang nach
Zerstörung lebloser Objecte, aber auch durch unmotivirte Angriffe
auf Personen äussernd, wozu die immer ungebundener sich
äussernden Triebe, insbesondere der Geschlechtstrieb und die
Leichtigkeit, mit welcher namentlich durch Widerstand Affecte
ausgelöst werden, ihrerseits beitragen.
Die eigentliche To b s u c h t charakterisirt
sich durch die höchsten Grade motorischer Tobsucht.
Aufregung. Der Kranke lärmt und schreit. Der innere Drang nach
Bewegungen explodirt förmlich zu diesen, ohne schliesslich mehr
durch Vorstellungen vermittelt zu werden und die Bewegungen
erhalten immer mehr den Charakter nicht intendirter Bewegungen,
obgleich sie niemals wie krampfartige, sondern stets wie gewollte
sich verhalten. Die Ideenflucht gestaltet sich zu einem ganz
ungeordneten Auftauchen, Jagen und Verdrängen der Vorstellungen,
deren Inhalt theils zufällig ganz verschieden und beständig
wechselnd sich gestaltet, theils durch Hallucinationen und Illusionen
beeinflusst wird. Letztere, sowie die daraus resultirenden
Wahnvorstellungen, sind nur flüchtiger Natur und ebenso wechselnd
wie die Stimmung, die ohne Uebergänge aus lärmend heiterer in die
finstere und drohende überspringt und selbst durch melancholische
Depressionszustände vorübergehend unterbrochen wird.
Es gibt vielfache Abweichungen von diesem Verlaufe der Manie,
die insbesondere die Dauer der ganzen Erkrankung und ihre
einzelnen Stadien betreffen, aber auch die einzelnen Symptome,
wobei die Ursachen der Psychose, namentlich aber der Umstand, ob
die nächste Krankheitsursache ein bisher gesundes, rüstiges Gehirn
oder ein von Haus aus oder in Folge bereits überstandener oder
noch bestehender Erkrankungen schon defectes getroffen hatte,
eine wesentliche Rolle spielt.
In gerichtsärztlicher Beziehung hat im
Allgemeinen die maniakische Exaltation eine Handlungen in
maniakalischer Exaltation.
viel grössere Bedeutung als die eigentliche
Tobsucht, weil letztere sich meist durch ausgesprochene, auch dem
Laien auffallende Symptome charakterisirt, während erstere
besonders in ihren Anfängen leicht verkannt werden kann, und nicht
selten selbst von den nächsten Angehörigen mitunter lange Zeit
verkannt wird. Und doch ist leicht einzusehen, dass, wie schon die
durch Alkoholgenuss bewirkte Exaltation, mit welcher die
maniakische eine so grosse Aehnlichkeit besitzt, so häufig zu
strafbaren Handlungen verleitet, noch leichter die maniakische zu
Conflicten mit dem Strafgesetze führen kann, da es sich bei dieser
meist um dauernde und zugleich viel intensivere Störungen des
Fühlens und des Vorstellens handelt, denen gegenüber eine
Correctur oder Beherrschung von Seite des Individuums schon
frühzeitig nicht mehr möglich ist, was bei Rauschzuständen
bekanntlich erst in den späteren Stadien geschieht. Die betreffenden
Handlungen haben jedoch insofern eine gewisse Aehnlichkeit, als sie
in beiden Fällen meist in Excessen verschiedener Art,
Widersetzlichkeiten gegen behördliche Organe, Ehren- und
Majestätsbeleidigungen, unsittlichen Attentaten, scheinbar
muthwilligen Beschädigungen fremden Eigenthums, Misshandlungen
und selbst Tödtungen von Personen bestehen, und in beiden Fällen
theils durch die reizbare und übermüthige Stimmung, theils durch
den erhöhten Drang nach Kraftäusserungen, theils durch die abnorm
erhöhten Triebe veranlasst werden, während Sinnestäuschungen
oder gar Wahnvorstellungen erst in den späteren Stadien des
Krankheitsverlaufes in’s Spiel kommen.
Eine besondere Erwähnung verdient die
sogenannte Mania acutissima oder Mania transitoria.
t r a n s i t o r i a . Es handelt sich nach K r a f f t -E b i n g , der diese Form der
Manie besonders eingehend behandelte[573], um einen bei vorher
ganz Gesunden auftretenden, in 20 Minuten bis 6 Stunden
verlaufenden Tobsuchtsanfall mit hochgradiger Verworrenheit,
massenhaften Sinnesdelirien und nachfolgender vollständiger
Amnesie. Charakteristisch ist auch die gleichsam kritische Lösung
des Anfalles mit einem Stadium tiefen Schlafes, aus welchem der
Betreffende psychisch wieder ganz frei erwacht. Solche im Leben des
Betreffenden meist ganz vereinzelte Anfälle wurden fast
ausschliesslich bei Männern, insbesondere bei jungen Männern
beobachtet. Vollblütigkeit, Geneigtheit zu Congestionen gegen den
Kopf scheinen ein prädisponirendes Moment zu bilden, und auch das
den Anfall zunächst auslösende dürfte in acuten Hyperämien des
Gehirnes und diese veranlassenden Ursachen, wie Alkoholgenuss,
grosse Hitze (Sonnenstich), Affecte u. dergl. m., zu suchen sein. Es
besteht eine grosse Aehnlichkeit solcher Anfälle mit gewissen, aus
epileptischer Ursache auftretenden Manien, weshalb sie von
Einzelnen auch als vereinzelt dastehende Anfälle psychischer
Epilepsie aufgefasst wurden. Auch die Gewaltthätigkeit und
Gefährlichkeit ist in beiden Fällen die gleiche. Jedenfalls wäre auf
etwa schon früher bestandene Anfälle ähnlicher Art, sowie auf
Epilepsie, insbesondere larvirte oder unbeachtet gebliebene, zu
reagiren. Die Beurtheilung solcher Vorkommnisse kann auch nur
nach den bei jener des einzelnen epileptischen Manieanfalles zu
beobachtenden Grundsätzen erfolgen. Das Plötzliche und
Unmotivirte des betreffenden Gebahrens, der wuthartige, planlose,
verworrene Charakter desselben, dann der allerdings nicht so leicht
zu liefernde Nachweis von Delirien und insbesondere der nie
fehlenden Amnesie sind Momente, die die Unterscheidung eines
solchen Anfalles von etwa blos in hochgradiger Gemüthserregung,
Jähzorn etc. begangenen Handlungen gestatten werden.
Zwei Fälle dieser Art werden von N e t o l i t z k y (Prag. med. Wochenschr. 1879,
pag. 310) mitgetheilt. Der erste Fall betraf einen 63jährigen, bisher ganz gesund
gewesenen Holzhacker. Derselbe kaufte sich am 4. April Morgens um 4 Kreuzer
Schnaps, trank gegen die Gewohnheit sofort die Hälfte aus, um sich wegen einer
durch schwere Arbeit veranlassten Erschöpfung zu stärken, klagte über
Kopfschmerzen und schickte sich an, in den Wald zu gehen. Er trank den Rest des
Branntweines und gerieth alsbald mit seinem Weibe ohne Ursache in Streit. Die
Nachbarn hörten ihn toben, sahen, wie er barfuss zum Schuster lief, der ihm
Stiefel flicken sollte; er borgte unter Drohungen von einem Nachbar einen
Schlitten, zerschlug seinen eigenen in Stücke, zankte heftig mit dem Nachbar,
agirte mit den Händen, schien sich gegen eine ihn bedrohende Macht zu
vertheidigen, rannte schliesslich in sein Haus, woselbst er unmittelbar darauf an
einem Dachsparren hängend gefunden wurde. Abgeschnitten und zu Athem
gebracht, verfiel er in einen 7stündigen Schlaf, aus welchem er mit vollständiger
Amnesie erwachte.
Im zweiten Falle war eine kräftige, bisher stets gesunde Lehrersfrau, nachdem
sie den ganzen Tag angestrengt gewaschen, bei starker Schwüle eine halbe
Stunde weit gegangen und hatte darauf gegen ihre Gewohnheit einen halben Liter
Bier getrunken. Zurückgekehrt klagte sie über Kopfschmerzen und legte sich um
10 Uhr in’s Bett. Gegen 1 Uhr erwachte ihr 7jähriger Knabe, sah die Mutter mit
einem Stricke in der Hand im Zimmer herumlärmen, aus dem Kasten ein Messer
hervorholen und die Schärfe desselben prüfen, wobei sie heftig gesticulirte und,
nachdem sie mit drohender Miene zum Bette des Knaben getreten war, das
Zimmer verliess. Der Knabe weckte den Vater, der ihr nacheilte und sie in der
Dachkammer aus einer tiefen Halswunde blutend traf, als sie sich eben aufhängen
wollte. N., sofort herbeigeholt, fand die Frau in grosser Unruhe, von schreckhaften
Wahnideen befallen, mit geröthetem Gesichte. Um 3 Uhr Nachts verfiel die Frau in
einen tiefen Schlaf, der 8 Stunden dauerte und aus dem sie ohne jegliche
Erinnerung an das Vorgefallene erwachte. Epilepsie war in keinem dieser Fälle
nachweisbar.
2. Complicirte Irrseinszustände.
b) Epileptisches Irrsein.
Der Rausch.
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.
ebooknice.com