Category : c#

I have a project A. I’m trying to request with the following line of code: return await _httpClient.PostAsync(requestUri, content); The requestUri I call is something simple: http://localhost:3036/api. This URL is from a docker container (project B). When I run this program (project A) running locally on my machine debugging in visual studio or in IIS, ..

Read more

I am running a code which opens a raw socket inside a docker container with kubernetes as the orchestrator. Following is my sample code: #include <stdio.h> #include <sys/socket.h> #include <stdlib.h> #include <errno.h> #include <netinet/tcp.h> #include <netinet/ip.h> #include <arpa/inet.h> #include <unistd.h> int main (void) { //Create a raw socket int s = socket (AF_INET, SOCK_RAW, IPPROTO_SCTP); ..

Read more

I am using a C# API that talks to DockerEngine (Docker.DotNet) to do some things, but notably in this case, removed a stopped container. Here is my code: foreach (var container in RunningContainers) { if (container.State == "dead" || container.State == "exited") { long exitType = Client.Containers.InspectContainerAsync(container.ID).Result.State.ExitCode; if (exitType != 0) { badExitCodeCount++; } Client.Containers.RemoveContainerAsync(container.ID, ..

Read more

I have been researching over on how to provide Python subprocess it’s own time and memory. import resource import subprocess def set_memory_time(seconds): limit_virtual_memory(seconds) usage_start = resource.getrusage(resource.RUSAGE_CHILDREN) print("usage_start ", usage_start) try: p = subprocess.check_output( [‘docker exec -it cpp_compiler sh -c "g++ -o Test1 prog1.cpp && ./Test1 < input.txt"’], shell=True) except Exception as e: print(e) usage_end = ..

Read more

I’m trying to develop a Vue.JS SPA and serve it using an ASP.NET Core core application which runs in a Docker container, while retaining the ability to have the SPA auto-update when I make changes to the code in Visual Studio 2019. I notice that .UseProxyToSpaDevelopmentServer() is provided through ISpaBuilder when configuring the app.UseSpa() call ..

Read more