# Class xxx() : yyy(){} to c# or java?

**URL:** <https://discuss.kotlinlang.org/t/class-xxx-yyy-to-c-or-java/17039>\
**Category:** Support\
**Created:** [April 9, 2020, 10:00am UTC](https://discuss.kotlinlang.org/t/class-xxx-yyy-to-c-or-java/17039 "2020-04-09T10:00:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![username77](https://avatars.discourse-cdn.com/v4/letter/u/7cd45c/32.png) [@username77](https://discuss.kotlinlang.org/u/username77)\
**Post date:** [April 9, 2020, 10:00am UTC](https://discuss.kotlinlang.org/t/class-xxx-yyy-to-c-or-java/17039/1 "2020-04-09T10:00:18Z")

</div>

```
Hi all, im an c# user and i never used kotlin/java before.

I have this working code on kotlin but im not able to convert into c# or to convert to java then to c#.

Any idea how to convert this class?

is an lightstreamer request, maybe an extend class of this class SessionRequest()

```

//code start  
//---------------------------------------------------------------  
package com.lightstreamer.client.requests  
import com.lightstreamer.client.session.InternalConnectionDetails  
import com.lightstreamer.client.session.InternalConnectionOptions

```
class CreateSessionRequest(targetServer: String, polling: Boolean, cause: String?, options: InternalConnectionOptions, details: InternalConnectionDetails, delay: Long, password: String?, oldSession: String?) : SessionRequest(polling, delay) {
    init {
        this.setServer(targetServer)
        this.addParameter("LS_op2", "create")
        this.addParameter("LS_polling", "true")
        if (cause != null) {
            this.addParameter("LS_cause", cause)
        }

        var requestedPollingInterval = 0L
        var requestedIdleTimeout = 0L
        if (polling) {
            requestedPollingInterval = options.pollingInterval + delay
            requestedIdleTimeout = options.idleTimeout
        }
}
override fun getRequestName(): String {
        return "create_session"
    }

    override fun isSessionRequest(): Boolean {
        return true
    }
}

```

//code end  
//---------------------------------------------------------------

---

<div class="post-metadata">

**Author:** ![al3c](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@al3c](https://discuss.kotlinlang.org/u/al3c)\
**Post date:** [April 9, 2020, 2:55pm UTC](https://discuss.kotlinlang.org/t/class-xxx-yyy-to-c-or-java/17039/2 "2020-04-09T14:55:50Z")

</div>

Is there something specific you don’t understand exactly? `CreateSessionRequest` inherits from `SessionRequest` and calls a constructor of it passing 2 arguments `polling, delay`.  
The rest is quite straightforward, the code block in `init` can be just put the body of a constructor, in `Java` at least.

---

<div class="post-metadata">

**Author:** ![giuseppe.corti](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@giuseppe.corti](https://discuss.kotlinlang.org/u/giuseppe.corti)\
**Post date:** [April 10, 2020, 10:19am UTC](https://discuss.kotlinlang.org/t/class-xxx-yyy-to-c-or-java/17039/3 "2020-04-10T10:19:53Z")

</div>

You can find [here](https://github.com/Lightstreamer/Lightstreamer-lib-client-dotnet/blob/master/Lightstreamer_DotNet_Client_Unified/com/lightstreamer/client/requests/CreateSessionRequest.cs) a C# version of the same class.

---

<div class="post-metadata">

**Author:** ![username77](https://avatars.discourse-cdn.com/v4/letter/u/7cd45c/32.png) [@username77](https://discuss.kotlinlang.org/u/username77)\
**Post date:** [April 10, 2020, 11:53am UTC](https://discuss.kotlinlang.org/t/class-xxx-yyy-to-c-or-java/17039/4 "2020-04-10T11:53:00Z")

</div>

thanks a lot.  
alla fine ero riuscito in qualche modo a farlo ieri sera dopo ore/giorni di tentativi.

La classe adesso è ok ma mi manca ancora molto da capire cosà c’è che non va con lightsteamer perchè non ricevo i segnali dal server. Da qualche parto sbaglio o manca qualcosa. Cercherò di registrarmi al forum di lightreamer.  
Grazie di nuovo
