Giter Club home page Giter Club logo

Comments (5)

hiram3512 avatar hiram3512 commented on May 26, 2024

1.主线程连接服务器之后的代码不再执行了:连接在线程中执行,不会阻塞主线程顺序执行的代码,如果后续的代码没有执行检查是否有异常抛出.如果是之后的连接事件不执行,连接成功后会执行成功事件,失败事件只有主动断开连接或者通信主机异常时抛出,建议心跳检测可以配合isconnect(上次是否连接正常)配合使用,具体参考TCP协议说明.
2.tcp.Socket.Nodelay报错可以抓取异常查看异常日志,如果是nullexception应该是Socket没有创建成功,如果是其他的异常建议参考异常信息,比如是否允许设置nodelay等

from hisocket.

Lijinqi avatar Lijinqi commented on May 26, 2024

1.主线程连接服务器的话,连接是正常的 通信也正常没问题。 会报以下这个异常
2.子线程也是报这个异常
3.捕获这个异常就能执行到 Connect()方法后了。
4.可以请教一下这个异常什么意思吗?搜索了一下 还是不明白....

System.Net.Sockets.SocketException (0x80004005): 提供了一个无效的参数。
   在 System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent)
   在 System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
   在 System.Net.Sockets.Socket.set_NoDelay(Boolean value)

from hisocket.

hiram3512 avatar hiram3512 commented on May 26, 2024

检查一下自己项目中socket的设置项,比如是否设置nodelay,是否设置timeout超时等具体参数

from hisocket.

Lijinqi avatar Lijinqi commented on May 26, 2024

我试了就是只在tcp.Socket.NoDelay = true; 这一句会有异常。可是这个参数感觉没什么问题啊 true 和 false。是否可能您框架内已经设置过了,所以我在设置会有问题?其他地方没有关于socket的设置。这些都是在example里copy的

from hisocket.

hiram3512 avatar hiram3512 commented on May 26, 2024

框架里面没有设置socket的参数(比如Nodelay等),这些需要根据自己的项目设置.
example只是示例展示给用户,Socket对象可以获取的,用户按照自己项目的独有性设置这些参数.

from hisocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.