public static void SubscribeAVGTime(this BO.PubSub @this) { using (new zAppDev.DotNet.Framework.Profiling.Profiler("PubSub", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "SubscribeAVGTime")) { zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "PubSub", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "NTUA AVGTime listening"); DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.SubRoot derp = new DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.SubRoot(); derp.authHash = "SarmedPortalAvgTime"; try { zAppDev.DotNet.Framework.Sockets.SocketClient sock = zAppDev.DotNet.Framework.Sockets.SocketClient.CreateConnection("SarmedPortalAvgTime", "147.102.4.108", 20004); sock.Send("{ \"authHash\" : \"" + "SarmedPortalAvgTime" + "\"}\n"); sock.StartReceiving((data) => { return(zAppDev.DotNet.Framework.Data.MiniSessionManager.ExecuteInUoW(manager => { string str = System.Text.Encoding.UTF8.GetString(data); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "str: " + str); DSS3_LogisticsPoolingForUrbanDistribution.BO.UtilsExtensions.DeserializeMessage(str); return true; })); }, "\n"); } catch (zAppDev.DotNet.Framework.Exceptions.BusinessException x) { zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "PubSub", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, x); } } }
public static void SubscribeOrders() { using (new zAppDev.DotNet.Framework.Profiling.Profiler("PubSub", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "SubscribeOrders")) { DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.SubRoot portal = new DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.SubRoot(); portal.authHash = "SarmedPortal"; try { zAppDev.DotNet.Framework.Sockets.SocketClient sock = zAppDev.DotNet.Framework.Sockets.SocketClient.CreateConnection("SarmedPortal", "147.102.4.108", 20004); sock.Send("{ \"authHash\" : \"" + portal.authHash + "\"}\n"); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "PubSub", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Listening for orders... (" + portal.authHash + ")"); sock.StartReceiving((data) => { return(zAppDev.DotNet.Framework.Data.MiniSessionManager.ExecuteInUoW(manager => { string str = System.Text.Encoding.UTF8.GetString(data); DSS3_LogisticsPoolingForUrbanDistribution.BO.UtilsExtensions.DeserializeMessage(str); return true; })); }, "\n"); } catch (zAppDev.DotNet.Framework.Exceptions.BusinessException x) { zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "PubSub", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, x.Message); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "PubSub", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, x.StackTrace); throw x; } } }