0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-28 07:58:14 +08:00
libzmq/man/man7/zmq_tcp.7

81 lines
2.6 KiB
Groff
Raw Normal View History

.TH zmq_tcp 7 "" "(c)2007-2010 iMatix Corporation" "0MQ User Manuals"
2009-12-03 12:58:16 +01:00
.SH NAME
0MQ TCP Transport \- unicast transport over the network
2009-12-03 12:58:16 +01:00
.SH SYNOPSIS
2010-01-12 13:08:37 +01:00
TCP is an ubiquitous unicast transport. When connecting distributed
applications, you will mostly use TCP transport.
.SH CONNECTION STRING
2010-01-18 13:16:14 +01:00
Connection string for TCP transport is "tcp://" followed by an IP address,
2010-01-12 13:08:37 +01:00
colon and port number. IP address can be either its numeric representation,
a NIC name or a hostname (resolved by DNS):
.nf
tcp://192.168.0.111:5555
tcp://myserver001:80
tcp://lo:32768
.fi
Note that NIC names are not standardised by POSIX. They tend to be rather
arbitrary and platform dependent. Say, "eth0" on Linux would correspond to "en0"
on OSX and "e1000g" on Solaris. On Windows platform, as there are no short NIC
names available, you have to use numeric IP addresses instead.
2010-01-12 13:08:37 +01:00
.SH WIRE FORMAT
A message consists of a message length followed by message data.
Size of message data MUST correspond to the message length.
For messages of 0 to 254 octets, the length is represented by single octet.
For messages of 255 or more octets the length is represented by a single octet
%xFF followed by a 64-bit unsigned integer length in network byte order.
The protocol can be defined by this BNF grammar:
.nf
frame = length data
length = OCTET | escape 8*OCTET
escape = %xFF
data = *OCTET
.fi
Binary layout of a message (up to 254 bytes long):
.nf
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message size | Message body ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message body ...
+-+-+-+-+-+-+- ...
Binary layout of a larger message:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0xff | Message size ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message size ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message size | Message body ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message body ...
+-+-+-+-+-+-+-+ ...
.fi
2009-12-03 12:58:16 +01:00
.SH "SEE ALSO"
2010-01-13 15:15:01 +01:00
.BR zmq_udp (7)
.BR zmq_pgm (7)
2010-01-15 14:11:39 +01:00
.BR zmq_ipc (7)
2010-01-13 15:15:01 +01:00
.BR zmq_inproc (7)
2009-12-03 12:58:16 +01:00
.SH AUTHOR
2009-12-04 10:06:46 +01:00
Martin Sustrik <sustrik at 250bpm dot com>
2009-12-03 12:58:16 +01:00