Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
4edb8df3
Commit
4edb8df3
authored
24 years ago
by
Martin Stjernholm
Browse files
Options
Downloads
Patches
Plain Diff
Initialize accepted connections to blocking mode.
Rev: lib/modules/Remote.pmod/Server.pike:1.10
parent
46394029
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Remote.pmod/Server.pike
+6
-0
6 additions, 0 deletions
lib/modules/Remote.pmod/Server.pike
with
6 additions
and
0 deletions
lib/modules/Remote.pmod/Server.pike
+
6
−
0
View file @
4edb8df3
...
@@ -39,6 +39,7 @@ class Minicontext
...
@@ -39,6 +39,7 @@ class Minicontext
void got_connection(object f)
void got_connection(object f)
{
{
object c = f->accept();
object c = f->accept();
c->set_blocking();
object con = Connection(0, max_call_threads);
object con = Connection(0, max_call_threads);
object ctx = Context(gethostname()+"-"+portno);
object ctx = Context(gethostname()+"-"+portno);
if (!c)
if (!c)
...
@@ -62,6 +63,8 @@ void create(string host, int p, void|int _max_call_threads)
...
@@ -62,6 +63,8 @@ void create(string host, int p, void|int _max_call_threads)
else if(!port->bind(p, got_connection, host))
else if(!port->bind(p, got_connection, host))
throw(({"Failed to bind to port\n", backtrace()}));
throw(({"Failed to bind to port\n", backtrace()}));
DEBUGMSG("listening to " + host + ":" + p + "\n");
if(!portno)
if(!portno)
sscanf(port->query_address(), "%*s %d", portno);
sscanf(port->query_address(), "%*s %d", portno);
...
@@ -76,11 +79,13 @@ void provide(string name, mixed thing)
...
@@ -76,11 +79,13 @@ void provide(string name, mixed thing)
void close()
void close()
{
{
DEBUGMSG("closing listening port\n");
destruct (port);
destruct (port);
}
}
void close_all()
void close_all()
{
{
DEBUGMSG("closing listening port and all connections\n");
destruct (port);
destruct (port);
foreach (connections, object conn) conn->close();
foreach (connections, object conn) conn->close();
}
}
...
@@ -92,5 +97,6 @@ int closed()
...
@@ -92,5 +97,6 @@ int closed()
void destroy()
void destroy()
{
{
DEBUGMSG("destruct" + (port ? " - closing listening port\n" : "\n"));
catch (destruct (port));
catch (destruct (port));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment