Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetMQMonitorSocketEventArgs #1061

Open
kcj3054 opened this issue Jun 8, 2023 · 5 comments
Open

NetMQMonitorSocketEventArgs #1061

kcj3054 opened this issue Jun 8, 2023 · 5 comments

Comments

@kcj3054
Copy link

kcj3054 commented Jun 8, 2023

Environment

NetMQ Version:  v4.0.1.12
Operating System: windows
.NET Version:  6.0   

problem

As I am using netmq in my current project, the current NetMQMonitorSocketEventArgs throws a socketException. Can you tell me the reason in detail?

@drewnoakes
Copy link
Member

That class cannot throw an exception.

/// <summary>
/// A subclass of <see cref="NetMQMonitorEventArgs"/> that also holds a socket.
/// </summary>
public class NetMQMonitorSocketEventArgs : NetMQMonitorEventArgs
{
/// <summary>
/// Create a new NetMQMonitorSocketEventArgs that contains the given monitor, address, and socket.
/// </summary>
/// <param name="monitor">The <see cref="NetMQMonitor"/> that raised this event.</param>
/// <param name="address">The address of the event.</param>
/// <param name="socketEvent">The type of socket event that occurred.</param>
/// <param name="socket">The socket upon which this event occurred.</param>
public NetMQMonitorSocketEventArgs(NetMQMonitor monitor, string address, AsyncSocket? socket, SocketEvents socketEvent)
: base(monitor, address, socketEvent)
{
Socket = socket;
}
/// <summary>
/// Gets the socket upon which this event occurred.
/// </summary>
public AsyncSocket? Socket { get; }
}

You will have to provide more details.

@kcj3054
Copy link
Author

kcj3054 commented Jun 8, 2023

The server was under load and the server was in the process of connecting to the gatewayServer. As the load continued, a socketException occurred, and the server was down again, so I tried to connect to the gatewayServer again.

@drewnoakes
Copy link
Member

Do you have a stack trace of the exception?

@kcj3054
Copy link
Author

kcj3054 commented Jun 8, 2023

Thread.StartCallback() -> NetMQPoller.Run -> NetMQPoller.Run -> NetMQPoller.RunPoller -> NetMQSocket.invokeEvents
-> NetmqMonitor.Handle -> ArgumentException("Command argument must be of type " + typeof (T).Name + ".");

@kcj3054
Copy link
Author

kcj3054 commented Jun 8, 2023

I am currently using multithreading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants