taskmanagerserver.java

来自「symbian s60 end to end socket程序源码 基于第二版」· Java 代码 · 共 41 行

JAVA
41
字号
/*
 * Copyright 2005 Nokia. All rights reserved.
 */
package com.forum.nokia.taskmanager.comm;

import java.io.*;
import javax.net.ssl.*;

/**
 * This class is the programs main class. It instantiates a new thread to handle
 * an incoming connection.
 *  
 */
public class TaskManagerServer
{
    /**
     * The port in which the server listens to inbound connections.
     */
    private static final int PORT = 33221;
    
    /**
     * Server entry-point, instantiates a new thread to handle the connection. 
     * 
     * @param args Command-line arguments, not used.
     * @throws IOException
     */
    public static void main(String[] args) throws IOException
    {
        SSLServerSocketFactory factory = (SSLServerSocketFactory) 
                                               SSLServerSocketFactory.getDefault();
        SSLServerSocket serverSocket = (SSLServerSocket)
         									   factory.createServerSocket( PORT );
        
        while( true )
        {
            new TaskManagerServerThread( (SSLSocket)
                    serverSocket.accept() ).start();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?