// --------------------------- SocketWrite ---------------------------
 private void SocketWrite( )
 {
     try
     {
         byte[] arrToSend = Encoding.ASCII.GetBytes(mSendMessage);
         AnySocket.Send(arrToSend, SocketFlags.None);
         AddMessage(NetworkRole.Client, mSendMessage);
     }
     catch (System.Exception excp)
     {
         ThrowNetworkException("Exception writing to " + ServerPortCombo, excp);
     }
 }
        // --------------------------- SocketRead -------------------------------
        // read the bytes from the socket, return its contents in string form.
        private string SocketRead(  )
        {
            string responseSegment = null;

            try
            {
                int    Lx     = 0;
                byte[] buffer = new byte[4096];
                Lx = AnySocket.Receive(buffer);
                responseSegment = Encoding.ASCII.GetString(buffer, 0, Lx);
                AddMessage(NetworkRole.Server, responseSegment);
            }
            catch (System.Exception excp)
            {
                ThrowNetworkException("Exception receiving from " + ServerPortCombo, excp);
            }

            return(responseSegment);
        }
Esempio n. 3
0
//		ArrayList mExchanges = null ;

        public NetworkServerTransaction(AnySocket InSock)
        {
            mSocket = InSock;
        }
 public ServerTransaction(AnySocket InSock)
 {
     mSocket = InSock;
 }