Skip to content

Commit

Permalink
Update comments on connections.nim
Browse files Browse the repository at this point in the history
  • Loading branch information
Clonkk authored Dec 15, 2023
1 parent 0c1906c commit 073831a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zmq/connections.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type

ZConnectionImpl* {.pure, final.} = object
## A Zmq connection. Since ``ZContext`` and ``ZSocket`` are pointers, it is highly recommended to **not** copy ``ZConnection``.
context*: ZContext ## Zmq context. Can be 'owned' by another connection (useful for inproc protocol).
socket*: ZSocket ## Embedded socket.
ownctx: bool ## Boolean indicating if the connection owns the Zmq context
alive: bool ## Boolean indicating if the connection has been closed
sockaddr: string ## Address of the embedded socket
context*: ZContext ## Zmq context from C-bindings.
socket*: ZSocket ## Zmq socket from C-bindings.
ownctx: bool # Boolean indicating if the connection owns the Zmq context
alive: bool # Boolean indicating if the connection has been closed
sockaddr: string # Address of the embedded socket

ZConnection * = ref ZConnectionImpl

Expand Down Expand Up @@ -213,7 +213,7 @@ proc bindAddr*(conn: var ZConnection, address: string) =
conn.sockaddr = address

proc connect*(address: string, mode: ZSocketType, context: ZContext): ZConnection =
## Open a new connection on an external ``ZContext`` and connect the socket
## Open a new connection on an external ``ZContext`` and connect the socket. External context are useful for inproc connections.
result = new(ZConnection)
result.context = context
result.ownctx = false
Expand Down Expand Up @@ -248,7 +248,7 @@ proc connect*(address: string, mode: ZSocketType): ZConnection =
result.ownctx = true

proc listen*(address: string, mode: ZSocketType, context: ZContext): ZConnection =
## Open a new connection on an external ``ZContext`` and binds on the socket
## Open a new connection on an external ``ZContext`` and binds on the socket. External context are useful for inproc connections.
runnableExamples:
import zmq
var monoserver = listen("tcp://127.0.0.1:34444", PAIR)
Expand Down

0 comments on commit 073831a

Please sign in to comment.