Bug 19875 - SocketOption throws exception
Summary: SocketOption throws exception
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-05-18 07:10 UTC by henrik
Modified: 2014-08-25 15:57 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description henrik 2014-05-18 07:10:25 UTC

13:04:47 api.1   |
13:04:47 api.1   | Unhandled Exception:
13:04:47 api.1   | System.Net.Sockets.SocketException: Invalid arguments
13:04:47 api.1   |   at System.Net.Sockets.Socket.SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at System.Net.Sockets.Socket.set_NoDelay (Boolean value) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at EventStore.ClientAPI.Transport.Tcp.TcpConnection.InitSocket (System.Net.Sockets.Socket socket) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at EventStore.ClientAPI.Transport.Tcp.TcpConnection+<>c__DisplayClass5.<CreateConnectingConnection>b__3 (System.Net.IPEndPoint _, System.Net.Sockets.Socket socket) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at EventStore.ClientAPI.Transport.Tcp.TcpClientConnector.OnSocketConnected (System.Net.Sockets.SocketAsyncEventArgs socketArgs) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at EventStore.ClientAPI.Transport.Tcp.TcpClientConnector.ProcessConnect (System.Net.Sockets.SocketAsyncEventArgs e) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at EventStore.ClientAPI.Transport.Tcp.TcpClientConnector.ConnectCompleted (System.Object sender, System.Net.Sockets.SocketAsyncEventArgs e) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted (System.Net.Sockets.SocketAsyncEventArgs e) [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at System.Net.Sockets.SocketAsyncEventArgs.ConnectCallback () [0x00000] in <filename unknown>:0
13:04:47 api.1   |   at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB (IAsyncResult ares) [0x00000] in <filename unknown>:0
Comment 1 Prashant manu 2014-08-21 03:55:38 UTC
We are getting 404 error while accessing the github link you shared.

Could you please provide us the test steps you followed. If possible please
attach a small complete project that demonstrates this behavior.

Also can you please add the logs from the following places?:
On XS IDE Log  Location: XS>Help> Open Log Directory> IDE.log file (with latest
Comment 2 Aaron Bockover [MSFT] 2014-08-21 06:31:13 UTC
This stack trace has nothing to do with Xamarin.Mac. The Mono Runtime version and concrete steps to reproduce the issue will be needed.
Comment 3 Aaron Bockover [MSFT] 2014-08-21 06:31:27 UTC
This stack trace has nothing to do with Xamarin.Mac. The Mono Runtime version and concrete steps to reproduce the issue will be needed.
Comment 4 henrik 2014-08-25 15:57:13 UTC
Mono 3.4.

Code is so easy to derive from the stack trace that I left it out. You are setting a boolean flag -- not that many ways to do that.

let s' = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
s'.NoDelay <- true

I tried this in the newly released mono 3.6 and that doesn't throw an exception, so we can consider this closed.