|
Attention! Read the forum rules carefully before posting a topic.
Try to find an answer in Wiki before asking a question. Submit programming questions in this forum only. Off topics are strictly forbidden.
Any topics which do not satisfy these rules will be deleted.
Socket connection on remote slot |
ayk
|
Post subject: Socket connection on remote slot |
Post rating: 0
|
Posted: Thu 27 Oct, 2011, 07:44
|
|
User rating: 0
Joined: Thu 28 Jul, 2011, 11:38 Posts: 9 Location: GermanyGermany
|
Hi,
is it possible connect to a remote slot server via strategie, which runs on dukascopys remote slot?
|
|
|
|
 |
API Support
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Thu 27 Oct, 2011, 08:23
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
ayk
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Thu 27 Oct, 2011, 14:30
|
|
User rating: 0
Joined: Thu 28 Jul, 2011, 11:38 Posts: 9 Location: GermanyGermany
|
Sry, my questions was not clear. I have a strategie, which connects to my server and sends me informations about open and closed trades (monitoring). Now on local, if i start my stratgie i get asked, if iwant to connect to remote server. After confirming, my socket connection is established and all work fine. Now my questions is, is it possible to use a socket connection in stratgie on remote slot, too? Tryed it with remote run, but on my server i dont see any connection, so think its not working. int port = 443 InetAddress addr = InetAddress.getByName("my.domain.com"); Socket socket = new Socket(addr, port); Its running in a seperate Thread. Thx for info.
|
|
|
|
 |
janjjj
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Thu 27 Oct, 2011, 15:56
|
|
User rating: 3
Joined: Thu 28 Jul, 2011, 19:40 Posts: 72 Location: PolandPoland
|
Hello, I use something like that and it work fine: Socket socket = new Socket("my.domain.com", 443); PrintWriter onServer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()), true); BufferedReader fromServer = new BufferedReader(new InputStreamReader(socket.getInputStream()));
onSerwer.println("smoething");
String line = null; if((line=zSerwera.readLine())!= null) { console.getOut().println(line); // do something.... }
I do it all in a separate thread.
|
|
|
|
 |
ayk
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Thu 27 Oct, 2011, 16:47
|
|
User rating: 0
Joined: Thu 28 Jul, 2011, 11:38 Posts: 9 Location: GermanyGermany
|
janjjj wrote: Hello, I use something like that and it work fine: Socket socket = new Socket("my.domain.com", 443); PrintWriter onServer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()), true); BufferedReader fromServer = new BufferedReader(new InputStreamReader(socket.getInputStream()));
onSerwer.println("smoething");
String line = null; if((line=zSerwera.readLine())!= null) { console.getOut().println(line); // do something.... }
I do it all in a separate thread. Thx janjjj, and your running this code on remote slot? not local?
|
|
|
|
 |
ayk
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Fri 28 Oct, 2011, 06:48
|
|
User rating: 0
Joined: Thu 28 Jul, 2011, 11:38 Posts: 9 Location: GermanyGermany
|
Nope, no chance... seams the security warning, with question to allow connection to host, is not granted...
|
|
|
|
 |
janjjj
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Wed 02 Nov, 2011, 14:19
|
|
User rating: 3
Joined: Thu 28 Jul, 2011, 19:40 Posts: 72 Location: PolandPoland
|
And if you use the directive: @RequiresFullAccess before class with your strategy?
Yes a use this code in remote slot.
|
|
|
|
 |
API Support
|
Post subject: Re: Socket connection on remote slot |
Post rating: 0
|
Posted: Wed 02 Nov, 2011, 15:04
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|