问题描述
我使用套接字将文件从Web角色移动到辅助角色,然后我将实体从辅助角色返回到Web角色,但是当工作进程在Worker中工作时套接字抛出了一个带有System.Net.Sockets.SocketException的AggregateException角色。记录:
I move a file from Web Role to Worker Role using a socket, then I return entity from Worker Role to Web Role, but socket throws an AggregateException with System.Net.Sockets.SocketException when process work in Worker Role. Log:
推荐答案
TcpListener 有一个完整的示例,了解如何绑定到地址/端口并侦听连接。除非您需要低级套接字访问,否则这可能是要使用的类型。如果您确实需要较低级别的套接字访问权限,请参阅文档
以获取
套接字,它还有一个如何绑定到端口并监听的完整示例。
The MSDN documentation for TcpListener has a complete example of how to bind to an address/port and listen for connections. Unless you need low-level socket access then this is probably the type to use. If you really need the lower-level socket access then refer to the documentation for Socket that also has a complete example of how to bind to the port and listen.
这篇关于WorkerRole在System.dll中抛出'System.Net.Sockets.SocketException'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!