Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ServerChat.java
Package: chat.zip [view]
Upload User: annion2008
Upload Date: 2021-03-11
Package Size: 38k
Code Size: 1k
Category:
MiddleWare
Development Platform:
Java
- import chat.servidor.*;
- import org.omg.CosNaming.*;
- import org.omg.CosNaming.NamingContextPackage.*;
- import org.omg.CORBA.*;
- import org.omg.PortableServer.*;
- import org.omg.PortableServer.POA;
- import java.util.Properties;
- public class ServerChat
- {
- public static void main(String[] args) {
- try {
- /* configures and initializes ORB */
- Properties props = new Properties();
- props.put("org.omg.CORBA.ORBInitialPort", "6666");
- ORB orb = ORB.init(args, props);
- POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
- rootpoa.the_POAManager().activate();
- ServerChatServant serverChat = new ServerChatServant();
- org.omg.CORBA.Object ref = rootpoa.servant_to_reference(serverChat);
- ChatService chatService = ChatServiceHelper.narrow(ref);
- org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
- NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
- String name = "ChatService";
- NameComponent path[] = ncRef.to_name(name);
- ncRef.rebind(path, ref);
- System.out.println("ChatService early and waiting...");
- orb.run();
- } catch (Exception e) {
- System.err.println("Error: " + e.getMessage());
- e.printStackTrace();
- } //catch
- } //main
- } //class ServerChat