Mercurial > hg > RemoteEditor > REPSessionManager
changeset 120:99e598a1dbf8
*** empty log message ***
author | pin |
---|---|
date | Thu, 17 Jan 2008 07:29:54 +0900 |
parents | 53bf80576e84 |
children | 80ef604d09dc |
files | rep/SessionList.java |
diffstat | 1 files changed, 14 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/SessionList.java Thu Jan 10 19:00:17 2008 +0900 +++ b/rep/SessionList.java Thu Jan 17 07:29:54 2008 +0900 @@ -1,33 +1,7 @@ package rep; -import java.beans.XMLEncoder; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.StringWriter; import java.nio.channels.SocketChannel; -import java.util.Hashtable; import java.util.LinkedList; -import java.util.List; - -import javax.swing.JButton; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Result; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - import rep.xml.SessionXMLEncoder; public class SessionList { @@ -43,6 +17,8 @@ private LinkedList<Session> tmpSessionList = new LinkedList<Session>(); private String maxHost; + //private TranslaterImp1 translater; + public SessionList(){ makeDefaultSession(); } @@ -80,9 +56,9 @@ sessionLinkedList.get(sid-1).addEditor(editorID, channel); //本当はforループで検索しないといけないよ。 } - public int getSessionID(SocketChannel channel) { - return 0; - } +// public int getSessionID(SocketChannel channel) { +// return 0; +// } public int getNumberOfEditor() { editorCount++; @@ -145,6 +121,7 @@ Editor editor2 = null; Editor editor3; // LinkedList <Editor> editorList = session3.get(repCmd.sid).getEditorList(); +// this.getSession(sid); LinkedList <Editor> editorList = sessionLinkedList.get(repCmd.sid-1).getEditorList(); //ここもforループで検索しないといけないよ。 for(Editor editor : editorList){ SocketChannel channel2 = editor.getChannel(); @@ -162,8 +139,9 @@ editor3 = editorList.get(editorList.indexOf(editor2)+1); } if(editor3 != null){ - REPPacketSend send = new REPPacketSend(editor3.getChannel()); - send.send(repCmd); + editor3.send(repCmd); + //REPPacketSend send = new REPPacketSend(editor3.getChannel()); + //send.send(repCmd); } } @@ -272,6 +250,11 @@ } public Session getSession(int sid) { + for(Session session : sessionLinkedList){ + if(session.getSID() == sid){ + return session; + } + } return sessionLinkedList.get(sid - 1); }