小编Ana*_*tar的帖子

在 c# 中获取错误无法访问已处理的对象对象名称='System.Net.Socket.Socket'

我想要一个 C# Client 和 Java Server 中的聊天应用程序

我通过了 C# 客户端,但是当我响应 Java 服务器时出现了一些错误,我得到了错误@

无法访问已处理的对象 object name='System.Net.Socket.Socket'

class Program
{
    static void Main(string[] args)
    {
        byte[] bytes = new byte[1024];// data buffer for incoming data

        // connect to a Remote device
        try
        {
            // Establish the remote end point for the socket
            IPHostEntry ipHost = Dns.Resolve("localhost");
           IPAddress ipAddr = ipHost.AddressList[0];
            IPEndPoint ipEndPoint = new IPEndPoint(ipAddr, 95);
            Socket Socketsender = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            // Connect the socket to the remote endpoint
            Socketsender.Connect(ipEndPoint); …
Run Code Online (Sandbox Code Playgroud)

c# java

-3
推荐指数
1
解决办法
3961
查看次数

标签 统计

c# ×1

java ×1