错误10042 - 在getsockopt或setsockopt中指定了错误的选项或级别 [英] Error 10042 - A bad option or level was specified in a getsockopt or setsockopt

查看:1114
本文介绍了错误10042 - 在getsockopt或setsockopt中指定了错误的选项或级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在VB.NET中构建一个应用程序,在GPS跟踪器和服务器之间读取GPRS通信协议,但是当我的套接字试图开始接收来自跟踪器的数据时,我得到错误10042。 br />

任何人都知道是什么让这件事发生了?以及如何解决它???


(我还写了一个客户端应用程序来证明它与我的服务器端应用程序,它运作良好)


我正在发布肠道代码以便你可以很好地看到它。

I?m trying to build an application in VB.NET that read GPRS communication protocols, between a GPS Tracker and Server, but when my socket tries to begin receiving the data that came from the tracker I get the error 10042.

Anyone knows what can make this to happen??? And how to fix it???

(I also wrote a client app to prove it with my server side app and it works good)

I''m posting the entery code so you can see it well.

展开 | 选择 | Wrap | 行号

推荐答案

你可以发布你的代码所做的与套接字相关的调用吗。


如果代码直接调用它们,特别是对getsockopt或setsockopt的任何调用。
Could you post the socket related calls that your code makes.

Particularly any calls to getsockopt or setsockopt if the code calls them directly.


Ok这是一个有趣的问题。


我什么也看不见在你的代码中,我立刻跳出来就是错误的。


顺便说一句,Banfa的getsockopt和setsockopt不是OP代码的一部分:关于Winsock的一些旧学校文章的文章
Ok, this is an interesting problem.

I don''t see anything that immediately jumps out at me as wrong in your code.

Btw, Banfa the getsockopt and setsockopt are not part of the OP''s code: Article on some old school stuff concerning Winsock.


不是这样,但是他的错误信息表明他们在某个地方被调用了我想象在它下面所有的.NET库仍然调用WinSock2


SocketType.Stream是否正确,在MSDN上示例使用SocketType :: Stream


FYI Goyem我更像是一个网络专家,而不是.NET专家,但幸运的是我们在这里有Frinny用于.NET的东西。
No that is true but his error message suggests they are getting called somewhere and I imagine that underneath it all the .NET library still calls out to WinSock2

Is SocketType.Stream correct, on MSDN the examples use SocketType::Stream

FYI Goyem I am more of a networking expert than a .NET expert but luckily we have Frinny in here for the .NET stuff.


这篇关于错误10042 - 在getsockopt或setsockopt中指定了错误的选项或级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆