Package javax.microedition.io

Examples of javax.microedition.io.SocketConnection


    /**
     * The socket listener loop.  Awaits a connection, processes requests from
     * the connection, then goes back to waiting, forever.
     */
    public void run() {
        SocketConnection sock;

        while (true) {
            d("listening on port " + PORT);
            try {
                sock = (SocketConnection)serv.acceptAndOpen();
View Full Code Here


            task.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|49-getter|1|49-execute

                    InputStream imageInputStream = fileCon.openInputStream();
                    transferWaitScreen.setText("Connecting to server on port " + serverPort + "...");
                    SocketConnection sc = (SocketConnection) Connector.open("socket://" +
                            serverAddress + ":" + serverPort);

                    DataInputStream dis = sc.openDataInputStream();
                    DataOutputStream dos = sc.openDataOutputStream();

                    transferWaitScreen.setText("Sending candidates number (" + candidatesNumber + ") ...");
                    dos.write(Integer.parseInt(candidatesNumber));
                    dos.flush();
View Full Code Here

      if(Modbus.debug) System.out.println("Listenening to " + m_ServerSocket.toString() + "(Port " + m_Port + ")");

      //Infinite loop, taking care of resources in case of a lot of parallel logins
      do {
        //FPFSocket incoming = m_ServerSocket.accept();
      SocketConnection incoming = (SocketConnection)m_ServerSocket.acceptAndOpen();
        if (Modbus.debug) System.out.println("Making new connection " + incoming.toString());
        if (m_Listening) {
          //FIXME: Replace with object pool due to resource issues
          m_ThreadPool.execute(
              new TCPConnectionHandler(
                  new TCPSlaveConnection(incoming)
              )
          );
          count();
        } else {
          //just close the socket
          incoming.close();
        }
      } while (m_Listening);
    } catch (IOException/*SocketException*/ iex) {
      if (!m_Listening) {
        return;
View Full Code Here

TOP

Related Classes of javax.microedition.io.SocketConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.