Unhandled Exception: System.Net.Sockets.SocketException: Protocol option not supported

Unhandled Exception: System.Net.Sockets.SocketException: Protocol option not supported

Postby marcusperez » Thu 30 May 2013 03:40

Hi,

I can't figure out what the problem is here. Hope someone can help me out. Thanks in advance!

Here are some details that might help...

    Windows 7 (Host machine)
    Solaris 10 (Virtual machine - Virtualbox)
    Mono
    C# compiled through Xamarin Studio
    Oracle 11g R2

I am executing the console application on the virtual Solaris Machine through Mono within the Gnome terminal. The Oracle database server is on the host machine (Windows 7).

I am able to connect from the guest Solaris machine to the Oracle database on the host machine using Sql Developer so I know I can reach the server.

Here's the C# code:

Code: Select all
using System;
using Devart.Data.Oracle;
using System.Net.Sockets;

namespace Console
{
   class MainClass
   {
      public static void Main (string[] args)
      {
         System.Console.WriteLine ("Hello World!");

         OracleConnectionStringBuilder connectionSB = new OracleConnectionStringBuilder();

         connectionSB.Direct = true;
         connectionSB.Server = "172.16.0.4";
         connectionSB.Port = 1521;
         connectionSB.Sid = "Oracle11g";
         connectionSB.ConnectMode = OracleConnectMode.SysDba;
         connectionSB.UserId = "sys";
         connectionSB.Password = "password";
         OracleConnection dbcon = new OracleConnection (connectionSB.ConnectionString);
         dbcon.Open ();
         dbcon.Close ();
         dbcon = null;
      }
   }
}


Here's the exception:

Code: Select all
Unhandled Exception: System.Net.Sockets.SocketException: Protocol option not supported
  at System.Net.Sockets.Socket.SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.TcpClient.set_ReceiveTimeout (Int32 value) [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.a.b (Int32 A_0) [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.b3.b (Int32 A_0) [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.j.a (Int32 A_0, b9 A_1) [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.c6.l () [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.c6.a (Devart.Data.Oracle.b5 A_0) [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.c6.a (Devart.Data.Oracle.b5 A_0, Devart.Data.Oracle.p A_1) [0x00000] in <filename unknown>:0
  at Devart.Data.Oracle.OracleInternalConnection..ctor (Devart.Data.Oracle.b5 connectionOptions, Devart.Data.Oracle.OracleInternalConnection proxyConnection) [0x00000] in <filename unknown>:0


What am I missing?

Regards,
Marcus
marcusperez
 
Posts: 1
Joined: Thu 30 May 2013 03:26

Re: Unhandled Exception: System.Net.Sockets.SocketException: Protocol option not supported

Postby Pinturiccio » Fri 31 May 2013 15:01

Mono for Solaris does not support SO_SNDTIMEO and SO_RCVTIMEO socket options. dotConnect for Oracle uses the ReceiveTimeout or SendTimeout properties for the socket object when a connection is opened. When working with the SendTimeout and SendTimeout properties, the SO_SNDTIMEO and SO_RCVTIMEO socket options are used. Thus, dotConnect for Oracle can't be used on Solaris system.
Pinturiccio
Devart Team
 
Posts: 2021
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle