Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BDCB49CEF for ; Tue, 10 Apr 2012 05:36:52 +0000 (UTC) Received: (qmail 55653 invoked by uid 500); 10 Apr 2012 05:36:50 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 55626 invoked by uid 500); 10 Apr 2012 05:36:50 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 55613 invoked by uid 99); 10 Apr 2012 05:36:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 05:36:50 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of puneetloya@gmail.com designates 209.85.212.172 as permitted sender) Received: from [209.85.212.172] (HELO mail-wi0-f172.google.com) (209.85.212.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 05:36:43 +0000 Received: by wibhj6 with SMTP id hj6so2286256wib.7 for ; Mon, 09 Apr 2012 22:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wRVvcFGconYsxpMs/kqMHA0yh4+XBVJNLhG5wbJpZyQ=; b=hB8QXrm7iBoBa3zjMwqWIDwTot3y3cztDXqAaxvO67pHKaiZS8AWhgPLFtuzpJVTG0 cm+HMCBmAJR+yxSukdG2DfQhf1vZTCQ1q+YCy7UWBosbXJ0L0c5UOzjJ4wEJaYmSvZBD wY5lw+n205BE16Vi3bEo94gJs9Um9JXQtZHa10DPD9nPEWBSIcaeLrEEUV7Hy7sUJ07C FY9Un1i0rncjCf6yxNEXg/KM79HXWiqDgACU91zB2i7P+7BG3GiTmeVB2umRGsUEJWW5 63yvUjjVjQbXUAFUJGjKiw784SvutiA+0Lrhb4zGAS2458oYWZnciOPQ+V66AmRv9RRd q//Q== MIME-Version: 1.0 Received: by 10.180.78.40 with SMTP id y8mr3679005wiw.15.1334036183013; Mon, 09 Apr 2012 22:36:23 -0700 (PDT) Received: by 10.223.103.208 with HTTP; Mon, 9 Apr 2012 22:36:22 -0700 (PDT) In-Reply-To: <-4313996965939721372@unknownmsgid> References: <-4313996965939721372@unknownmsgid> Date: Tue, 10 Apr 2012 11:06:22 +0530 Message-ID: Subject: Re: cassandra and .net From: puneet loya To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=f46d043c80b4ce587104bd4c80e9 --f46d043c80b4ce587104bd4c80e9 Content-Type: text/plain; charset=ISO-8859-1 hi, sorry i posted the port as 7000. I m using 9160 but still has the same error. "Cannot read, Remote side has closed". Can u guess whats happening?? On Tue, Apr 10, 2012 at 11:00 AM, Pierre Chalamet wrote: > hello, > > 9160 is probably the port to use if you use the default config. > > - Pierre > > On Apr 10, 2012, at 7:26 AM, puneet loya wrote: > > > using System; > > using System.Collections.Generic; > > using System.Linq; > > using System.Text; > > using Thrift.Collections; > > using Thrift.Protocol; > > using Thrift.Transport; > > using Apache.Cassandra; > > > > namespace ConsoleApplication1 > > { > > class Program > > { > > static void Main(string[] args) > > { > > TTransport transport=null; > > try > > { > > transport = new TBufferedTransport(new > TSocket("127.0.0.1", 7000)); > > > > > > //if(buffered) > > // trans = new TBufferedTransport(trans as > TStreamTransport); > > //if (framed) > > // trans = new TFramedTransport(trans); > > > > TProtocol protocol = new TBinaryProtocol(transport); > > Cassandra.Client client = new Cassandra.Client(protocol); > > > > Console.WriteLine("Opening connection"); > > > > if (!transport.IsOpen) > > transport.Open(); > > > > client.describe_keyspace("abc"); // > Crashing at this point > > > > } > > catch (Exception ex) > > { > > Console.WriteLine(ex.Message); > > } > > finally > > { if(transport!=null) > > transport.Close(); } > > Console.ReadLine(); > > } > > } > > } > > > > I m trying to interact with cassandra server(database) from .net. For > that i have referred two libraries i.e, apacheCassandra08.dll and > thrift.dll.. In the following piece of code the connection is getting > opened but when i m using client object it is giving an error stating > "Cannot read, Remote side has closed". > > > > Can any1 help me out with this? Has any1 faced the same prob? > > > > > --f46d043c80b4ce587104bd4c80e9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable hi,

sorry i posted the port as 7000. I m using 9160 but = still has the same error.
=A0
"Cannot read, Remote= side has closed". =A0
Can u guess whats happening??

On Tue, Apr 10, 2012 at 11:00 AM, Pierre Cha= lamet <pierre@c= halamet.net> wrote:
hello,

9160 is probably the port to use if you use the default config.

- Pierre

On Apr 10, 2012, at 7:26 AM, puneet loya <puneetloya@gmail.com> wrote:

> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using Thrift.Collections;
> using Thrift.Protocol;
> using Thrift.Transport;
> using Apache.Cassandra;
>
> namespace ConsoleApplication1
> {
> =A0 =A0 class Program
> =A0 =A0 {
> =A0 =A0 =A0 =A0 static void Main(string[] args)
> =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 TTransport transport=3Dnull;
> =A0 =A0 =A0 =A0 =A0 =A0 try
> =A0 =A0 =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 transport =3D new TBufferedTransport(n= ew TSocket("127.0.0.1", 7000));
>
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 //if(buffered)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // =A0 =A0 =A0 =A0 =A0 =A0trans =3D ne= w TBufferedTransport(trans as TStreamTransport);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 //if (framed)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // =A0 =A0trans =3D new TFramedTranspo= rt(trans);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 TProtocol protocol =3D new TBinaryProt= ocol(transport);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Cassandra.Client client =3D new Cassan= dra.Client(protocol);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Console.WriteLine("Opening connec= tion");
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!transport.IsOpen)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 transport.Open();
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 client.describe_keyspace("abc&quo= t;); =A0 =A0 =A0 =A0 =A0 =A0 =A0 // Crashing at this point
>
> =A0 =A0 =A0 =A0 =A0 }
> =A0 =A0 =A0 =A0 =A0 =A0 catch (Exception ex)
> =A0 =A0 =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Console.WriteLine(ex.Message);
> =A0 =A0 =A0 =A0 =A0 =A0 }
> =A0 =A0 =A0 =A0 =A0 =A0 finally
> =A0 =A0 =A0 =A0 =A0 =A0 { if(transport!=3Dnull)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 transport.Close(); }
> =A0 =A0 =A0 =A0 =A0 =A0 Console.ReadLine();
> =A0 =A0 =A0 =A0 }
> =A0 =A0 }
> }
>
> I m trying to interact with cassandra server(database) from .net. For = that i have referred two libraries i.e, apacheCassandra08.dll and thrift.dl= l.. In the following piece of code the connection is getting opened but whe= n i m using client object it is giving an error stating "Cannot read, = Remote side has closed".
>
> Can any1 help me out with this? Has any1 faced the same prob?
>
>

--f46d043c80b4ce587104bd4c80e9--