Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 27 17:42
    L0PiTaL opened #1621
  • Sep 22 06:11
    waxwax0099 opened #1620
  • Sep 19 20:28
    JochenBaier opened #1619
  • Sep 16 18:39
    kiufta opened #1618
  • Sep 12 06:45
    HKGY opened #1088
  • Sep 08 20:25
    lakshminareshk closed #1615
  • Sep 08 11:58
    lakshminareshk opened #1615
  • Aug 28 10:08
    chuanqi723 closed #1614
  • Aug 28 04:07
    chuanqi723 opened #1614
  • Aug 28 04:04
    chuanqi723 closed #1612
  • Aug 22 08:21
    asuper0 opened #1613
  • Aug 20 16:12
    gdamore labeled #1081
  • Aug 20 16:10
    gdamore closed #1083
  • Aug 20 16:10

    gdamore on master

    fixes #1083 Missing a markdown … (compare)

  • Aug 20 16:06
    gdamore transferred #1086
  • Aug 20 16:06
    gdamore edited #1612
  • Aug 20 16:06
    chuanqi723 opened #1612
  • Aug 20 16:05
    gdamore closed #1082
  • Aug 20 16:05

    gdamore on master

    Fixed #1082 (#1085) (compare)

  • Aug 20 16:00

    gdamore on master

    Markup fix (compare)

wangfeiily
@wangfeiily
or multiple push node (connect) one pull node(bind).
It's not exactly like what you said on the web
can u help me ?
if u can show me a demo, it would be better
Garrett D'Amore
@gdamore
You need to have multiple bind addresses. Each server for example should bind to its own address. Each client should then connect to each server. (So the client calls connect multiple times.)
You can swap server and client if you like. It doesn’t matter which side does connect and which does bind.
You cannot get many-to-many without having multiple bind addresses though. You can only bind one process to an address at a time (normally- there are some newer ways to get around that but they aren’t supported.)
wangfeiily
@wangfeiily
OK, I got it , thanks a lot.
Raymond-Sun
@Raymond-Sun
hello, the document protocol section mentioned:"The nng_pub0_open() function creates a pub version 0 socket and returns it at the location pointed to by s." , so, what is "version 0 socket"?
the document page title , such as "nng_pub_open(3) " , what is the meaning "(3)"
nng(7), what is the meaning "(7)"
Garrett D'Amore
@gdamore
Those are man page sections. Section 3 is for library functions. Section 7 is for device drivers. This is ancient UNIX (and also Linux history).
Raymond-Sun
@Raymond-Sun
hello, the document protocol section mentioned:"The nng_pub0_open() function creates a pub version 0 socket and returns it at the location pointed to by s." , so, what is "version 0 socket"?
Garrett D'Amore
@gdamore
The protocols are versioned. For pub and sub there is only version zero at this time.
alexzorin
@alexzorin

Hi! I have a rep TCP server which implements a small stateful protocol using a fixed pool of nng_aio/nng_ctx.

Ideally I'd like to drop (RST) peers which commit a protocol violation: free up the connection and context for another peer. I'm feeling that perhaps that this is a TCP-transport-specific idea and I'm not too sure how to marry what I'm trying to do with how the nng APIs are designed to be used.

One idea I've had has been to approach it in the same way as the REST server example, which involves closing and then recreating the nng_ctx for each new client.

Questions:

  1. Is it possible to do what I want (drop clients and free up the context) with a fixed pool of nng_ctx?
  2. If not, are there any example aio programs which demonstrate how to close/reuse/create contexts against a server socket? I'm not seeing how to do it without the benefit of something like nng_http_server which the REST example uses. Or just a description of the pattern more broadly.

Thank you for the great library!

Garrett D'Amore
@gdamore
We have moved off of gitter. Mostly because its client support is awful.
If youre worried about SP layer protocol violations - don’t. NNG takes care of it for you.
You don’t have to link disconnects to peers though. If you have a message and want to disconnect the peer that sent it you can get the pipe from the message and then call nng_pipe_close on it. Nothing prevents the peer from reconnecting however.
1 reply
We are using discord for our chat these days.
darpan101
@darpan101
I have query regarding nanomsg ----do this support UDP?
In case of binary message how Topic name works?
Xu Jingxin
@sailxjx
I use bus protocol to construct a mesh of services, however, not every service is interested in all topics. So, to reduce the network overhead, is there a way to support subscribe(topic) in bus protocol?
I have created an issue here, hope someone can help me. nanomsg/nng#1568
Mikhail Kagalenko
@kagalenko-m-b
Hello, what is required to build nng on Windows 7?
gdamore
@gdamore:matrix.org
[m]
Visual Studio works. Otherwise its cmake and a compiler (eg clang) and either nmake or ninja (prefererred)
Oh wait. Windows 7.
That isnt really supported I think. It may work but I can’t test it and can’t promise anything older than Windows 8 works.
Mikhail Kagalenko
@kagalenko-m-b
mingw fails, complaining about missing sys/socket.h
gdamore
@gdamore:matrix.org
[m]
Yeah. You might need mingw64.
Even then i cannot promise it will work.
Windows 7 is LONG eol. I cannot support it. I can’t even get an image with it to test with.
Mikhail Kagalenko
@kagalenko-m-b
it is mingw64
"System is unknown to cmake, create:
Platform/MINGW64_NT-6.1-7601 to use this system, please post your config file on discourse.cmake.org so it can be added to cmake"
gdamore
@gdamore:matrix.org
[m]
Yeah. So likely too old system.
Cmake may have dropped support.
You can try building for windows 8. It might run on windows 7.
Mainstream support for Windows 7 ended 7 years ago. Extended support ended 2.5 years ago. Why in heavens name would you be developing new software for this OS?
Mikhail Kagalenko
@kagalenko-m-b
because it works and does not have spyware present in the current windows
gdamore
@gdamore:matrix.org
[m]
Windows 8 is hardly current. But Windows 7 is not getting security updates anymore so it will soon be a nice host to ransomwares and malware.
But anyway I am not in a position to help with Windows 7. I can’t get it for testing against even.
Mikhail Kagalenko
@kagalenko-m-b
OK, instead of using mingw/msys cmake, I installed cmake built for windows, and it created build files without complaints, msys seems to be building so far
Mikhail Kagalenko
@kagalenko-m-b
make test reports 96% percent passing,
The following tests FAILED:
32 - nng.sp.transport.ipc.ipc_test (Failed)
46 - nng.ipc (Exit code 0xc0000264
)
48 - nng.multistress (Exit code 0xc0000264
)
maybe it will be useful to somebody
so win7 build is mostly working
gdamore
@gdamore:matrix.org
[m]
Base mingw doesnt work. You need mingw64. Or just visual studio.
There are some critical APIs that mingw lacks that we depend on.
Basically vanilla mingw exposes APIs available in Windows XP but lacks stuff added in Vista and later. Really old stuff. Nobody should use mingw.
Mikhail Kagalenko
@kagalenko-m-b
Yes, I mean mingw64
Mikhail Kagalenko
@kagalenko-m-b
The second argument to nng_send(), void *data does not have const qualifier. Any reason for that?
gdamore
@gdamore:matrix.org
[m]
Yes. Because if you give it the NNG_ALLOC flag then it might free the memory.