Beispiel #1
0
        /// <summary>
        /// Starts the new.
        /// </summary>
        /// <param name="port">The port.</param>
        /// <returns></returns>
        public static Server StartNew(BaseRemoteObjectSerializer serial = null, int port = RemoteConstants.DefaultPort)
        {
            var server = new Server(serial, port);

            server.Start();
            return(server);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Server"/> class.
 /// </summary>
 /// <param name="port">The port.</param>
 public Server(BaseRemoteObjectSerializer serial = null, int port = RemoteConstants.DefaultPort)
 {
     this.Serialization = serial ?? DefaultSerializer;
     this.listener      = new TcpListener(IPAddress.Any, port);
 }
Beispiel #3
0
 public static object ToObject(this IEnumerable <byte> raw, BaseRemoteObjectSerializer reader) => reader.ToObject <object>(raw.ToArray());
Beispiel #4
0
 public static MessageAsBytes ToMessageAsBytes(this object source, BaseRemoteObjectSerializer reader) => reader.ToByteArray(source);
Beispiel #5
0
 public static T ToObject <T>(this byte[] raw, BaseRemoteObjectSerializer reader) => reader.ToObject <T>(raw);