xsocket-develop Mailing List for xsocket (Page 6)
Status: Inactive
Brought to you by:
grro
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
(9) |
Nov
(11) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(8) |
Feb
(9) |
Mar
(9) |
Apr
(22) |
May
(28) |
Jun
(17) |
Jul
(10) |
Aug
(19) |
Sep
(4) |
Oct
(14) |
Nov
(26) |
Dec
(25) |
| 2009 |
Jan
(13) |
Feb
(17) |
Mar
(12) |
Apr
(4) |
May
(16) |
Jun
(6) |
Jul
(10) |
Aug
(24) |
Sep
(6) |
Oct
(5) |
Nov
(13) |
Dec
(10) |
| 2010 |
Jan
(17) |
Feb
(21) |
Mar
(10) |
Apr
(8) |
May
(2) |
Jun
(14) |
Jul
(7) |
Aug
(10) |
Sep
(7) |
Oct
(3) |
Nov
|
Dec
(2) |
| 2011 |
Jan
(1) |
Feb
(5) |
Mar
(1) |
Apr
|
May
(5) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|
From: quan n. h. <hu...@gm...> - 2010-01-13 04:39:29
|
hi i have a thread using INonBlockingConnection outsite xSocket thread to send & receiving data with client (my program is server). it send ok, but when receive data, it throw exception: java.io.BufferUnderflowException (because it conflict with onData thread of xSocket ??) i try add ConnectionUtils.synchronizedConnection method but it still throw error. any suggest? thanks -Quan |
|
From: Cyrus H. <cy...@cy...> - 2009-12-26 10:04:42
|
OMG, how fool I am! Sorry for asking kind of RTFM question... On Sat, Dec 26, 2009 at 6:41 PM, Gregor Roth <gre...@gm...> wrote: > Hi Cyrus, > > > you did not include the xsocket library to the classpath by starting the > application > > > java kr.cyrush.xSocketTest.xSTServer 9081 > > > Gregor > > > > > ----- Original Message ----- > > From: Gregor Roth > > Sent: 12/25/09 05:21 AM > > To: Cyrus Hackford > > Subject: [xSocket-develop] Hello. I have got a problem while following > xSocket tutorial. > > > I have used sources below, compiled them using xSocket 2.8.1 which I > downloaded from sf.net. > Compiling itself threw no error, but when I tried to execute, "*Exception > in thread "main" java.lang.NoClassDefFoundError: > org/xsocket/connection/IHandler*" occured. > So, I downloaded whole xSocket source from sf.net, compiled it myself, > "jar"ed it myself with version.txt inside it. But same exception occured. > > Here are the sources I have wrote. > > > // xSTServer.java > package kr.cyrush.xSocketTest; > > import org.xsocket.connection.Server; > > public class xSTServer { > > private static Server tSrv; > > public static void main(String[] args) { > if(args.length!=1) { > System.out.println("Usage: java kr.cyrush.xSocketTest.xSTServer > <port>"); > System.exit(1); > } > > try { > tSrv=new Server(Integer.parseInt(args[0]),new xSTServerUnit()); > tSrv.run(); > } catch(Exception e) { > System.out.println(e.getMessage()); > } > } > > protected static void shutItDown() { > try { > tSrv.close(); > } catch(Exception e) { > System.out.println(e.getMessage()); > } > } > > } > > > > // xSTServerUnit.java > package kr.cyrush.xSocketTest; > > import java.io.IOException; > import java.nio.BufferUnderflowException; > import java.nio.channels.ClosedChannelException; > import org.xsocket.MaxReadSizeExceededException; > import org.xsocket.connection.IDataHandler; > import org.xsocket.connection.INonBlockingConnection; > > > public class xSTServerUnit implements IDataHandler { > > public boolean onData(INonBlockingConnection nbc) throws > IOException,BufferUnderflowException,MaxReadSizeExceededException { > > String data=nbc.readStringByDelimiter(new > Character('\n').toString()); > nbc.write(data+new Character('\n').toString()); > > if(data.equalsIgnoreCase("SHUTDOWN")) > xSTServer.shutItDown(); > > return true; > } > } > > > > // commands I used: (let's suppose that the sources are in > ~/java/sources/kr/cyrush/xSocketTest) > > cd ~/java/sources > javac -cp ~/java/lib/xSocket-2.8.1.jar -d ../classes > kr/cyrush/xSocketTest/*.java > cd ../classes > java kr.cyrush.xSocketTest.xSTServer 9081 > > Then, the exception occurs. > I cannot figure what is the problem out. > I have googled the Exception but nothing found except Sun's Java API saying > that the exception occurs when JVM cannot find class definition. > What is class definition? And why xSocket's IHandler does not hav it? > > Please answer my question. > Thank you. > > -- > Cyrus Hackford; Sent from my Mac > ---------------- > email : cy...@cy... <#125ca5ca435a9b24_> > > > > -- Cyrus Hackford; Sent from my Mac ---------------- email : cy...@cy... gtalk : cy...@cy... aim : cyrushackford msn : cy...@cy... & cyr...@cy... ping! (iphone) : cyrush.kr (Sorry, do not ping! me. My iPod is currently out of order..) skype : cyrus_hackford |
|
From: Gregor R. <gre...@gm...> - 2009-12-26 09:41:39
|
|
From: Cyrus H. <cy...@cy...> - 2009-12-25 04:50:35
|
I have used sources below, compiled them using xSocket 2.8.1 which I downloaded from sf.net. Compiling itself threw no error, but when I tried to execute, "*Exception in thread "main" java.lang.NoClassDefFoundError: org/xsocket/connection/IHandler*" occured. So, I downloaded whole xSocket source from sf.net, compiled it myself, "jar"ed it myself with version.txt inside it. But same exception occured. Here are the sources I have wrote. // xSTServer.java package kr.cyrush.xSocketTest; import org.xsocket.connection.Server; public class xSTServer { private static Server tSrv; public static void main(String[] args) { if(args.length!=1) { System.out.println("Usage: java kr.cyrush.xSocketTest.xSTServer <port>"); System.exit(1); } try { tSrv=new Server(Integer.parseInt(args[0]),new xSTServerUnit()); tSrv.run(); } catch(Exception e) { System.out.println(e.getMessage()); } } protected static void shutItDown() { try { tSrv.close(); } catch(Exception e) { System.out.println(e.getMessage()); } } } // xSTServerUnit.java package kr.cyrush.xSocketTest; import java.io.IOException; import java.nio.BufferUnderflowException; import java.nio.channels.ClosedChannelException; import org.xsocket.MaxReadSizeExceededException; import org.xsocket.connection.IDataHandler; import org.xsocket.connection.INonBlockingConnection; public class xSTServerUnit implements IDataHandler { public boolean onData(INonBlockingConnection nbc) throws IOException,BufferUnderflowException,MaxReadSizeExceededException { String data=nbc.readStringByDelimiter(new Character('\n').toString()); nbc.write(data+new Character('\n').toString()); if(data.equalsIgnoreCase("SHUTDOWN")) xSTServer.shutItDown(); return true; } } // commands I used: (let's suppose that the sources are in ~/java/sources/kr/cyrush/xSocketTest) cd ~/java/sources javac -cp ~/java/lib/xSocket-2.8.1.jar -d ../classes kr/cyrush/xSocketTest/*.java cd ../classes java kr.cyrush.xSocketTest.xSTServer 9081 Then, the exception occurs. I cannot figure what is the problem out. I have googled the Exception but nothing found except Sun's Java API saying that the exception occurs when JVM cannot find class definition. What is class definition? And why xSocket's IHandler does not hav it? Please answer my question. Thank you. -- Cyrus Hackford; Sent from my Mac ---------------- email : cy...@cy... |
|
From: Gregor R. <gre...@gm...> - 2009-12-18 14:49:22
|
|
From: Gregor R. <gre...@gm...> - 2009-12-17 22:19:50
|
|
From: ilia P. <ili...@gm...> - 2009-12-17 14:05:14
|
Hello, I am new using xsocket, where can I find instalation guide with eclipse, maybe working examples and so on. Do you have forum online ? Thank you very mach, Prizker Ilia |
|
From: Gregor R. <gre...@gm...> - 2009-12-07 07:16:12
|
|
From: Cory I. <cor...@co...> - 2009-12-07 01:07:18
|
If you use an ad hoc secure SSL connection mid-session, is there a way to turn off secure mode afterward so that later messages are accepted by the server unencrypted? For example: Receive message1 server.activateSecureMode Receive message2 // deactivate secure mode Receive message3 Thanks, Cory |
|
From: Cory I. <cor...@co...> - 2009-12-06 22:41:01
|
If you use an ad hoc secure SSL connection mid-session, is there a way to turn off secure mode afterward so that later messages are accepted by the server unencrypted? For example: Receive message1 server.activateSecureMode Receive message2 // deactivate secure mode Receive message3 Thanks, Cory |
|
From: Cory I. <cor...@co...> - 2009-12-06 22:27:34
|
If you use an ad hoc secure SSL connection mid-session, is there a way to turn off secure mode afterward so that later messages are accepted by the server unencrypted? For example: Receive message1 server.activateSecureMode Receive message2 // deactivate secure mode Receive message3 Thanks, Cory |
|
From: Gregor R. <gre...@gm...> - 2009-11-27 12:51:13
|
|
From: K. <kev...@qq...> - 2009-11-27 07:34:17
|
Where is the xSocket's support forum? |
|
From: Gregor R. <gre...@gm...> - 2009-11-24 05:04:34
|
|
From: kashinath p. <kas...@gm...> - 2009-11-23 10:39:43
|
Hi,
I am writing a test server and checking whether the data can be sent in
realtime using xsocket.
I wrote the code the server and the flex client were working fine.
But after some time the server side throws the following exception and then
stops streaming data saying the connection is closed.
org.xsocket.connection.ExtendedClosedChannelException: could not write.
channel is close or not initialized (id=d69a994312520a7ac862c16d311S1
(closed))
at
org.xsocket.connection.AbstractNonBlockingStream.ensureStreamIsOpenAndWritable(AbstractNonBlockingStream.java:1527)
Does this imply the client is closing the connection or the connection was
timed out?
Thanks for the help in advance!
--
Regards,
Kashi
|
|
From: Gregor R. <gre...@gm...> - 2009-11-18 04:23:53
|
|
From: <mgs...@tl...> - 2009-11-17 23:31:17
|
Hello, I have built an application (Java applet) using xsocket library. I am getting the following errors: 2009-11-17 23:29:38 org.xsocket.connection.IoProvider readProperty WARNING: invalid value for system property org.xsocket.connection.dispatcher.initialCount java.security.AccessControlException: access denied (java.util.PropertyPermission org.xsocket.connection.dispatcher.initialCount read) 2009-11-17 23:29:38 org.xsocket.connection.IoProvider readProperty WARNING: invalid value for system property org.xsocket.connection.client.dispatcher.initialCount java.security.AccessControlException: access denied (java.util.PropertyPermission org.xsocket.connection.client.dispatcher.initialCount read) 2009-11-17 23:29:38 org.xsocket.connection.IoProvider readProperty WARNING: invalid value for system property org.xsocket.connection.server.dispatcher.initialCount java.security.AccessControlException: access denied (java.util.PropertyPermission org.xsocket.connection.server.dispatcher.initialCount read) 2009-11-17 23:29:38 org.xsocket.connection.IoProvider readProperty Could You, please, help me resolve the following issues? Sincerely Yours, Slawek |
|
From: Gregor R. <gre...@gm...> - 2009-11-08 11:50:47
|
|
From: Jonas M. <sa...@gm...> - 2009-11-06 15:19:53
|
Any exception that comes from onData() , onConnect() etc is swallowed and logged like this; HandlerAdapter : [ae0c487b124ca0e078019bbf914S3] runtime exception occured while performing onData multithreaded com.ssb.swimmer2.SwimmerServer#24230975 java.lang.RuntimeException: java.lang.IllegalMonitorStateException What I expect to happen when my code throws a RuntimeException without catching somewhere it is that it should terminate the application... On Thu, Nov 5, 2009 at 4:12 PM, Gregor Roth <gre...@gm...> wrote: > Hello Jonas, > > > I will go through the code, looking for such places. It will be great, if > you give me some input. > > > Thanks > > Gregor > > > ----- Original Message ----- > > From: Jonas Minnberg > > Sent: 11/05/09 02:51 pm > > To: xso...@li... > > Subject: [xSocket-develop] xSocket 2.7 STILL swallowing exceptions > > > > My biggest gripe with xSocket is still there; that it catches all > exceptions thrown in application code and just logs it as a warning. > Why, o why is that so? It makes finding problems in your code so much > harder, especially since it doesn't print the stack trace. > > // Jonas > > > > |
|
From: xiang l. <jxt...@gm...> - 2009-11-06 06:26:06
|
subcribe,xsocket -- Best Regards, Xiang Liu |
|
From: Gregor R. <gre...@gm...> - 2009-11-05 15:13:15
|
|
From: Jonas M. <sa...@gm...> - 2009-11-05 13:51:22
|
My biggest gripe with xSocket is still there; that it catches all exceptions thrown in application code and just logs it as a warning. Why, o why is that so? It makes finding problems in your code so much harder, especially since it doesn't print the stack trace. // Jonas |
|
From: Phyo A. <phy...@gm...> - 2009-11-03 23:53:08
|
Hi gregor; Thanks a lot.I have see How it works now 1 . TcpClinent Sents Channel ID 2. Web Server Sets tcpclient's Communication at Sent ID at http://127.0.0.1/(sentID) <http://127.0.0.1/%28sentID%29> 3. Web Client Tries to post Hello You to that url. 4. "Hello You" arrived to tcp client which set Channel ID. What I am trying to achieve is to make both incoming connections , readable and writable , to act Dual Port server as just a simple IO Pipe between two side of TCP Clients .Other side read what Other side Writes and vice-versa . Not just for http I want to be any kind of TCP connection so they will be send as it is. So i am learning how to modify dual port server to work as that way. 1. Will replace HttpRequestHandler part with TcpConnectHandler 2. To Put whole Connection , so both can read or write there? I need some suggestion 3. When OnData , copy data to another side and write there , vice-versa. Please suggest and share me some idea tools , i like xsocket , a lot more simpler and powerful than Apache Mina! Regards, Phyo. On Mon, Nov 2, 2009 at 7:03 AM, Gregor Roth <gre...@gm...> wrote: > Hi Phyo, > > please see also the JUnit class SimpleDualPortServerTest which is located > in the same package. I suppose that the exception will be caused by a non > PUT/POST-Reuest and/or by a invalid URI. Please consider that the > SimpleDualPortServer is a simple, incomplete example. Especially validations > checks are missing. E.g. if a GET-Request is received, an exception will be > caused by the missing body. > > Gregor > > ----- Original Message ----- > > From: Phyo Arkar > > Sent: 11/01/09 01:29 am > > To: Gregor Roth > > Subject: Re: [xSocket-develop] Trying to implement a Dual Port Server with > XSocket > > > > When i run , and connect with web browser to port 8080 (i change ports to > 8080 and 9090) it got error , as below.. > > on browser it gives InternalServerError too. > > Am i doing something wrong? > > Nov 1, 2009 6:55:54 AM org.xsocket.connection.Server$LifeCycleHandler > onConnected > INFO: server listening on 0.0.0.0:8080<http://mail-eu.gmx.com/fm07/cgi/derefer?TYPE=2&DEST=http%3A%2F%2F0.0.0.0%3A8080>(xLightweb 2.9/xSocket 2.7) > Nov 1, 2009 6:55:54 AM org.xsocket.connection.Server$LifeCycleHandler > onConnected > INFO: server listening on 0.0.0.0:9090<http://mail-eu.gmx.com/fm07/cgi/derefer?TYPE=2&DEST=http%3A%2F%2F0.0.0.0%3A9090>(xSocket 2.7) > Nov 1, 2009 6:56:16 AM > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter > performRequestHandler > WARNING: [78a41f9f124ad22431b5f0a2165S1] error occured by calling on > request > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter@1a1c887<#124b7ce92b5aa6b9_124b3b44687db324_>java.lang.NumberFormatException: For input string: "" > at java.lang.NumberFormatException.forInputString(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at > SimpleDualPortServer$HttpRequestHandler.onRequest(SimpleDualPortServer.java:116) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.performRequestHandler(AbstractHttpConnection.java:2083) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.access$1400(AbstractHttpConnection.java:1993) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter$1.run(AbstractHttpConnection.java:2271) > at > org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161) > at > org.xsocket.SerializedTaskQueue.access$0(SerializedTaskQueue.java:139) > at > org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown > Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > > Nov 1, 2009 6:56:16 AM > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter > performRequestHandler > WARNING: [78a41f9f124ad22431b5f0a2165S2] error occured by calling on > request > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter@1a1c887<#124b7ce92b5aa6b9_124b3b44687db324_>java.lang.NumberFormatException: For input string: "favicon.ico" > at java.lang.NumberFormatException.forInputString(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at > SimpleDualPortServer$HttpRequestHandler.onRequest(SimpleDualPortServer.java:116) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.performRequestHandler(AbstractHttpConnection.java:2083) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.access$1400(AbstractHttpConnection.java:1993) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter$1.run(AbstractHttpConnection.java:2271) > at > org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161) > at > org.xsocket.SerializedTaskQueue.access$0(SerializedTaskQueue.java:139) > at > org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown > Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > > Nov 1, 2009 6:56:19 AM > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter > performRequestHandler > WARNING: [78a41f9f124ad22431b5f0a2165S3] error occured by calling on > request > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter@1a1c887<#124b7ce92b5aa6b9_124b3b44687db324_>java.lang.NumberFormatException: For input string: "favicon.ico" > at java.lang.NumberFormatException.forInputString(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at > SimpleDualPortServer$HttpRequestHandler.onRequest(SimpleDualPortServer.java:116) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.performRequestHandler(AbstractHttpConnection.java:2083) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.access$1400(AbstractHttpConnection.java:1993) > at > org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter$1.run(AbstractHttpConnection.java:2271) > at > org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161) > at > org.xsocket.SerializedTaskQueue.access$0(SerializedTaskQueue.java:139) > at > org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown > Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > > > > On Sun, Nov 1, 2009 at 6:00 AM, Phyo Arkar <phy...@gm...<#124b7ce92b5aa6b9_124b3b44687db324_> > > wrote: > >> Dear Gregor >> >> Thanks a lot , I am check the code and i will test it out >> >> Regards, >> >> Phyo >> >> >> On Sat, Oct 31, 2009 at 8:10 PM, Gregor Roth <gre...@gm...<#124b7ce92b5aa6b9_124b3b44687db324_> >> > wrote: >> >>> Hi Phyo, >>> >>> >>> you can find a simple example for a dual port server here: >>> http://xlightweb.svn.sourceforge.net/viewvc/xlightweb/xlightweb/core/trunk/src/test/java/org/xlightweb/SimpleDualPortServer.java?view=markup<http://mail-eu.gmx.com/fm07/cgi/derefer?TYPE=2&DEST=http%3A%2F%2Fxlightweb.svn.sourceforge.net%2Fviewvc%2Fxlightweb%2Fxlightweb%2Fcore%2Ftrunk%2Fsrc%2Ftest%2Fjava%2Forg%2Fxlightweb%2FSimpleDualPortServer.java%3Fview%3Dmarkup> >>> >>> >>> Gregor >>> >>> >>> >>> ----- Original Message ----- >>> >>> From: Phyo Arkar >>> >>> Sent: 10/31/09 02:42 am >>> >>> To: xso...@li...<#124b7ce92b5aa6b9_124b3b44687db324_> >>> >>> Subject: [xSocket-develop] Trying to implement a Dual Port Server with >>> XSocket >>> >>> >>> >>> Hello XSocket Developers >>> >>> I am new to XSocket and trying to implement a Dual Port Server , One Port >>> accept incoming connection , read data and when other side connect , reply >>> to them >>> >>> >>> here is my example >>> >>> >>> RemoteWebServer<---Agent ---------------------------->XSocketServer:8090 >>> <----------------> XSocketServer:9080 <<<<--------->Browser >>> >>> >>> I am wondering how to communicate data Internally between >>> XSocketServer:8090 <---------> XSocketServer:9080; >>> >>> >>> I am thinking to use shared synchronized object : >>> >>> Only Xsocket is used on server side relay is with socat ( >>> dest-unreachable.com<http://mail-eu.gmx.com/fm07/cgi/derefer?TYPE=2&DEST=http%3A%2F%2Fmail-eu.gmx.com%2Ffm07%2Fcgi%2Fderefer%3FTYPE%3D2%26amp%3BDEST%3Dhttp%253A%252F%252Fdest-unreachable.com> >>> ) >>> >>> >>> >>> Below is my code as far as it goes it dont work :D. will appreciate a lot >>> for anyyy help : >>> >>> >>> //------------ Begins >>> import java.io.IOException; >>> import java.nio.BufferUnderflowException; >>> import org.xsocket.MaxReadSizeExceededException; >>> import org.xsocket.connection.IDataHandler; >>> import org.xsocket.connection.IConnectHandler; >>> >>> import org.xsocket.connection.INonBlockingConnection; >>> >>> class Shared { >>> >>> static INonBlockingConnection camNBC = null; >>> static INonBlockingConnection brwNBC = null; >>> boolean value_cam = false; >>> boolean value_brw = false; >>> >>> synchronized INonBlockingConnection get_cam() { >>> if (value_cam == false) >>> try { >>> wait(); >>> } catch (InterruptedException e) { >>> System.out.println("InterruptedException caught"); >>> } >>> System.out.println("Gives Cam's: " + camNBC); >>> value_cam = false; >>> notify(); >>> return camNBC; >>> } >>> >>> synchronized void put_cam(INonBlockingConnection nbc) { >>> if (value_cam == true) >>> try { >>> wait(); >>> } catch (InterruptedException e) { >>> System.out.println("InterruptedException caught"); >>> } >>> this.camNBC = nbc; >>> System.out.println("Set Camera: " + nbc); >>> value_cam = false; >>> notify(); >>> } >>> >>> synchronized INonBlockingConnection get_brw() { >>> if (value_brw == false) >>> try { >>> wait(); >>> } catch (InterruptedException e) { >>> System.out.println("InterruptedException caught"); >>> } >>> System.out.println("Gives brw: " + brwNBC); >>> value_brw = false; >>> notify(); >>> return brwNBC; >>> } >>> >>> synchronized void put_brw(INonBlockingConnection nbc) { >>> if (value_brw == true) >>> try { >>> wait(); >>> } catch (InterruptedException e) { >>> System.out.println("InterruptedException caught"); >>> } >>> this.brwNBC = nbc; >>> System.out.println("Set brw: " + nbc); >>> value_brw = false; >>> notify(); >>> } >>> >>> } >>> >>> class BrowserHandler implements IDataHandler,IConnectHandler { >>> >>> Shared s; >>> >>> BrowserHandler(Shared s) { >>> this.s = s; >>> } >>> @Override<#124b7ce92b5aa6b9_124b3b44687db324_124acef4188edf77_124aad346b05e7db_> >>> public boolean onConnect(INonBlockingConnection connection) >>> throws IOException, BufferUnderflowException, >>> MaxReadSizeExceededException { >>> // TODO Auto-generated method stub >>> s.put_brw(connection); >>> return false; >>> } >>> public boolean onData(INonBlockingConnection nbc) throws IOException, >>> BufferUnderflowException, MaxReadSizeExceededException { >>> String data = nbc.readStringByDelimiter("\n"); >>> this.s.get_cam().write(data + " \r\n\r\n"); >>> return true; >>> >>> } >>> >>> >>> } >>> >>> class CameraHandler implements IDataHandler,IConnectHandler { >>> >>> Shared s; >>> >>> public CameraHandler(Shared s) { >>> this.s = s; >>> } >>> @Override<#124b7ce92b5aa6b9_124b3b44687db324_124acef4188edf77_124aad346b05e7db_> >>> public boolean onConnect(INonBlockingConnection connection) >>> throws IOException, BufferUnderflowException, >>> MaxReadSizeExceededException { >>> // TODO Auto-generated method stub >>> s.put_cam(connection); >>> return false; >>> } >>> public boolean onData(INonBlockingConnection nbc) throws IOException, >>> BufferUnderflowException, MaxReadSizeExceededException { >>> >>> String data = nbc.readStringByDelimiter("\n"); >>> this.s.get_brw().write(data + " \r\n"); >>> return true; >>> } >>> >>> >>> } >>> >>> >>> import java.io.IOException; >>> import org.xsocket.connection.IServer; >>> import org.xsocket.connection.Server; >>> >>> >>> public class main { >>> >>> public static void main(String args[]) { >>> try { >>> Shared s= new Shared(); >>> IServer browse_side = new Server(8090, new BrowserHandler(s)); >>> IServer cam_side = new Server(9080, new CameraHandler(s)); >>> >>> // run it within the current thread. >>> //srv.run(); // the call will not return >>> >>> // ... or start it by using a dedicated thread >>> >>> browse_side.start(); >>> cam_side.start(); >>> } catch (IOException e) { >>> // TODO Auto-generated catch block >>> e.printStackTrace(); >>> } // returns after the server has been started >>> >>> >>> } >>> >>> } >>> >>> >>> >>> >>> >>> >>> >> > > > |
|
From: Phyo A. <phy...@gm...> - 2009-11-01 00:31:16
|
When i run , and connect with web browser to port 8080 (i change ports to
8080 and 9090) it got error , as below..
on browser it gives InternalServerError too.
Am i doing something wrong?
Nov 1, 2009 6:55:54 AM org.xsocket.connection.Server$LifeCycleHandler
onConnected
INFO: server listening on 0.0.0.0:8080 (xLightweb 2.9/xSocket 2.7)
Nov 1, 2009 6:55:54 AM org.xsocket.connection.Server$LifeCycleHandler
onConnected
INFO: server listening on 0.0.0.0:9090 (xSocket 2.7)
Nov 1, 2009 6:56:16 AM
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter
performRequestHandler
WARNING: [78a41f9f124ad22431b5f0a2165S1] error occured by calling on request
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$Mul...@1a....NumberFormatException:
For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at
SimpleDualPortServer$HttpRequestHandler.onRequest(SimpleDualPortServer.java:116)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.performRequestHandler(AbstractHttpConnection.java:2083)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.access$1400(AbstractHttpConnection.java:1993)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter$1.run(AbstractHttpConnection.java:2271)
at
org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161)
at
org.xsocket.SerializedTaskQueue.access$0(SerializedTaskQueue.java:139)
at
org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Nov 1, 2009 6:56:16 AM
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter
performRequestHandler
WARNING: [78a41f9f124ad22431b5f0a2165S2] error occured by calling on request
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$Mul...@1a....NumberFormatException:
For input string: "favicon.ico"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at
SimpleDualPortServer$HttpRequestHandler.onRequest(SimpleDualPortServer.java:116)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.performRequestHandler(AbstractHttpConnection.java:2083)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.access$1400(AbstractHttpConnection.java:1993)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter$1.run(AbstractHttpConnection.java:2271)
at
org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161)
at
org.xsocket.SerializedTaskQueue.access$0(SerializedTaskQueue.java:139)
at
org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Nov 1, 2009 6:56:19 AM
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter
performRequestHandler
WARNING: [78a41f9f124ad22431b5f0a2165S3] error occured by calling on request
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$Mul...@1a....NumberFormatException:
For input string: "favicon.ico"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at
SimpleDualPortServer$HttpRequestHandler.onRequest(SimpleDualPortServer.java:116)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.performRequestHandler(AbstractHttpConnection.java:2083)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter.access$1400(AbstractHttpConnection.java:1993)
at
org.xlightweb.AbstractHttpConnection$RequestHandlerAdapter$MultithreadedRequestHandlerAdapter$1.run(AbstractHttpConnection.java:2271)
at
org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161)
at
org.xsocket.SerializedTaskQueue.access$0(SerializedTaskQueue.java:139)
at
org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
On Sun, Nov 1, 2009 at 6:00 AM, Phyo Arkar <phy...@gm...> wrote:
> Dear Gregor
>
> Thanks a lot , I am check the code and i will test it out
>
> Regards,
>
> Phyo
>
>
> On Sat, Oct 31, 2009 at 8:10 PM, Gregor Roth <gre...@gm...> wrote:
>
>> Hi Phyo,
>>
>>
>> you can find a simple example for a dual port server here:
>> http://xlightweb.svn.sourceforge.net/viewvc/xlightweb/xlightweb/core/trunk/src/test/java/org/xlightweb/SimpleDualPortServer.java?view=markup
>>
>>
>> Gregor
>>
>>
>>
>> ----- Original Message -----
>>
>> From: Phyo Arkar
>>
>> Sent: 10/31/09 02:42 am
>>
>> To: xso...@li...
>>
>> Subject: [xSocket-develop] Trying to implement a Dual Port Server with
>> XSocket
>>
>>
>>
>> Hello XSocket Developers
>>
>> I am new to XSocket and trying to implement a Dual Port Server , One Port
>> accept incoming connection , read data and when other side connect , reply
>> to them
>>
>>
>> here is my example
>>
>>
>> RemoteWebServer<---Agent ---------------------------->XSocketServer:8090
>> <----------------> XSocketServer:9080 <<<<--------->Browser
>>
>>
>> I am wondering how to communicate data Internally between
>> XSocketServer:8090 <---------> XSocketServer:9080;
>>
>>
>> I am thinking to use shared synchronized object :
>>
>> Only Xsocket is used on server side relay is with socat (
>> dest-unreachable.com<http://mail-eu.gmx.com/fm07/cgi/derefer?TYPE=2&DEST=http%3A%2F%2Fdest-unreachable.com>
>> )
>>
>>
>>
>> Below is my code as far as it goes it dont work :D. will appreciate a lot
>> for anyyy help :
>>
>>
>> //------------ Begins
>> import java.io.IOException;
>> import java.nio.BufferUnderflowException;
>> import org.xsocket.MaxReadSizeExceededException;
>> import org.xsocket.connection.IDataHandler;
>> import org.xsocket.connection.IConnectHandler;
>>
>> import org.xsocket.connection.INonBlockingConnection;
>>
>> class Shared {
>>
>> static INonBlockingConnection camNBC = null;
>> static INonBlockingConnection brwNBC = null;
>> boolean value_cam = false;
>> boolean value_brw = false;
>>
>> synchronized INonBlockingConnection get_cam() {
>> if (value_cam == false)
>> try {
>> wait();
>> } catch (InterruptedException e) {
>> System.out.println("InterruptedException caught");
>> }
>> System.out.println("Gives Cam's: " + camNBC);
>> value_cam = false;
>> notify();
>> return camNBC;
>> }
>>
>> synchronized void put_cam(INonBlockingConnection nbc) {
>> if (value_cam == true)
>> try {
>> wait();
>> } catch (InterruptedException e) {
>> System.out.println("InterruptedException caught");
>> }
>> this.camNBC = nbc;
>> System.out.println("Set Camera: " + nbc);
>> value_cam = false;
>> notify();
>> }
>>
>> synchronized INonBlockingConnection get_brw() {
>> if (value_brw == false)
>> try {
>> wait();
>> } catch (InterruptedException e) {
>> System.out.println("InterruptedException caught");
>> }
>> System.out.println("Gives brw: " + brwNBC);
>> value_brw = false;
>> notify();
>> return brwNBC;
>> }
>>
>> synchronized void put_brw(INonBlockingConnection nbc) {
>> if (value_brw == true)
>> try {
>> wait();
>> } catch (InterruptedException e) {
>> System.out.println("InterruptedException caught");
>> }
>> this.brwNBC = nbc;
>> System.out.println("Set brw: " + nbc);
>> value_brw = false;
>> notify();
>> }
>>
>> }
>>
>> class BrowserHandler implements IDataHandler,IConnectHandler {
>>
>> Shared s;
>>
>> BrowserHandler(Shared s) {
>> this.s = s;
>> }
>> @Override <#124acef4188edf77_124aad346b05e7db_>
>> public boolean onConnect(INonBlockingConnection connection)
>> throws IOException, BufferUnderflowException,
>> MaxReadSizeExceededException {
>> // TODO Auto-generated method stub
>> s.put_brw(connection);
>> return false;
>> }
>> public boolean onData(INonBlockingConnection nbc) throws IOException,
>> BufferUnderflowException, MaxReadSizeExceededException {
>> String data = nbc.readStringByDelimiter("\n");
>> this.s.get_cam().write(data + " \r\n\r\n");
>> return true;
>>
>> }
>>
>>
>> }
>>
>> class CameraHandler implements IDataHandler,IConnectHandler {
>>
>> Shared s;
>>
>> public CameraHandler(Shared s) {
>> this.s = s;
>> }
>> @Override <#124acef4188edf77_124aad346b05e7db_>
>> public boolean onConnect(INonBlockingConnection connection)
>> throws IOException, BufferUnderflowException,
>> MaxReadSizeExceededException {
>> // TODO Auto-generated method stub
>> s.put_cam(connection);
>> return false;
>> }
>> public boolean onData(INonBlockingConnection nbc) throws IOException,
>> BufferUnderflowException, MaxReadSizeExceededException {
>>
>> String data = nbc.readStringByDelimiter("\n");
>> this.s.get_brw().write(data + " \r\n");
>> return true;
>> }
>>
>>
>> }
>>
>>
>> import java.io.IOException;
>> import org.xsocket.connection.IServer;
>> import org.xsocket.connection.Server;
>>
>>
>> public class main {
>>
>> public static void main(String args[]) {
>> try {
>> Shared s= new Shared();
>> IServer browse_side = new Server(8090, new BrowserHandler(s));
>> IServer cam_side = new Server(9080, new CameraHandler(s));
>>
>> // run it within the current thread.
>> //srv.run(); // the call will not return
>>
>> // ... or start it by using a dedicated thread
>>
>> browse_side.start();
>> cam_side.start();
>> } catch (IOException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> } // returns after the server has been started
>>
>>
>> }
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>
|
|
From: Phyo A. <phy...@gm...> - 2009-10-31 23:30:43
|
Dear Gregor Thanks a lot , I am check the code and i will test it out Regards, Phyo On Sat, Oct 31, 2009 at 8:10 PM, Gregor Roth <gre...@gm...> wrote: > Hi Phyo, > > > you can find a simple example for a dual port server here: > http://xlightweb.svn.sourceforge.net/viewvc/xlightweb/xlightweb/core/trunk/src/test/java/org/xlightweb/SimpleDualPortServer.java?view=markup > > > Gregor > > > > ----- Original Message ----- > > From: Phyo Arkar > > Sent: 10/31/09 02:42 am > > To: xso...@li... > > Subject: [xSocket-develop] Trying to implement a Dual Port Server with > XSocket > > > > Hello XSocket Developers > > I am new to XSocket and trying to implement a Dual Port Server , One Port > accept incoming connection , read data and when other side connect , reply > to them > > > here is my example > > > RemoteWebServer<---Agent ---------------------------->XSocketServer:8090 > <----------------> XSocketServer:9080 <<<<--------->Browser > > > I am wondering how to communicate data Internally between > XSocketServer:8090 <---------> XSocketServer:9080; > > > I am thinking to use shared synchronized object : > > Only Xsocket is used on server side relay is with socat ( > dest-unreachable.com<http://mail-eu.gmx.com/fm07/cgi/derefer?TYPE=2&DEST=http%3A%2F%2Fdest-unreachable.com> > ) > > > > Below is my code as far as it goes it dont work :D. will appreciate a lot > for anyyy help : > > > //------------ Begins > import java.io.IOException; > import java.nio.BufferUnderflowException; > import org.xsocket.MaxReadSizeExceededException; > import org.xsocket.connection.IDataHandler; > import org.xsocket.connection.IConnectHandler; > > import org.xsocket.connection.INonBlockingConnection; > > class Shared { > > static INonBlockingConnection camNBC = null; > static INonBlockingConnection brwNBC = null; > boolean value_cam = false; > boolean value_brw = false; > > synchronized INonBlockingConnection get_cam() { > if (value_cam == false) > try { > wait(); > } catch (InterruptedException e) { > System.out.println("InterruptedException caught"); > } > System.out.println("Gives Cam's: " + camNBC); > value_cam = false; > notify(); > return camNBC; > } > > synchronized void put_cam(INonBlockingConnection nbc) { > if (value_cam == true) > try { > wait(); > } catch (InterruptedException e) { > System.out.println("InterruptedException caught"); > } > this.camNBC = nbc; > System.out.println("Set Camera: " + nbc); > value_cam = false; > notify(); > } > > synchronized INonBlockingConnection get_brw() { > if (value_brw == false) > try { > wait(); > } catch (InterruptedException e) { > System.out.println("InterruptedException caught"); > } > System.out.println("Gives brw: " + brwNBC); > value_brw = false; > notify(); > return brwNBC; > } > > synchronized void put_brw(INonBlockingConnection nbc) { > if (value_brw == true) > try { > wait(); > } catch (InterruptedException e) { > System.out.println("InterruptedException caught"); > } > this.brwNBC = nbc; > System.out.println("Set brw: " + nbc); > value_brw = false; > notify(); > } > > } > > class BrowserHandler implements IDataHandler,IConnectHandler { > > Shared s; > > BrowserHandler(Shared s) { > this.s = s; > } > @Override <#124aad346b05e7db_> > public boolean onConnect(INonBlockingConnection connection) > throws IOException, BufferUnderflowException, > MaxReadSizeExceededException { > // TODO Auto-generated method stub > s.put_brw(connection); > return false; > } > public boolean onData(INonBlockingConnection nbc) throws IOException, > BufferUnderflowException, MaxReadSizeExceededException { > String data = nbc.readStringByDelimiter("\n"); > this.s.get_cam().write(data + " \r\n\r\n"); > return true; > > } > > > } > > class CameraHandler implements IDataHandler,IConnectHandler { > > Shared s; > > public CameraHandler(Shared s) { > this.s = s; > } > @Override <#124aad346b05e7db_> > public boolean onConnect(INonBlockingConnection connection) > throws IOException, BufferUnderflowException, > MaxReadSizeExceededException { > // TODO Auto-generated method stub > s.put_cam(connection); > return false; > } > public boolean onData(INonBlockingConnection nbc) throws IOException, > BufferUnderflowException, MaxReadSizeExceededException { > > String data = nbc.readStringByDelimiter("\n"); > this.s.get_brw().write(data + " \r\n"); > return true; > } > > > } > > > import java.io.IOException; > import org.xsocket.connection.IServer; > import org.xsocket.connection.Server; > > > public class main { > > public static void main(String args[]) { > try { > Shared s= new Shared(); > IServer browse_side = new Server(8090, new BrowserHandler(s)); > IServer cam_side = new Server(9080, new CameraHandler(s)); > > // run it within the current thread. > //srv.run(); // the call will not return > > // ... or start it by using a dedicated thread > > browse_side.start(); > cam_side.start(); > } catch (IOException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } // returns after the server has been started > > > } > > } > > > > > > > |