Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TIES323
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
joalhelk
TIES323
Commits
bf5e9c41
Commit
bf5e9c41
authored
3 years ago
by
joalhelk
Browse files
Options
Downloads
Patches
Plain Diff
fixed timeouts
parent
c7a24e56
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
TFTPServer/TFTPServer/Server.cs
+4
-10
4 additions, 10 deletions
TFTPServer/TFTPServer/Server.cs
with
4 additions
and
10 deletions
TFTPServer/TFTPServer/Server.cs
+
4
−
10
View file @
bf5e9c41
...
...
@@ -114,6 +114,7 @@ namespace TFTPServer
/// <param name="remote"></param>
private
static
bool
WaitAcknowledge
(
int
number
,
EndPoint
remote
)
{
socket
.
ReceiveTimeout
=
socket_timeout
;
byte
[]
buffer
=
new
byte
[
4
];
try
{
...
...
@@ -127,9 +128,12 @@ namespace TFTPServer
SendError
(
remote
,
ERROR_CODE
.
Not_defined
,
"invalid ack packet"
);
return
false
;
}
socket
.
ReceiveTimeout
=
30000
;
return
true
;
}
catch
(
SocketException
)
{
socket
.
ReceiveTimeout
=
30000
;
return
false
;
}
}
...
...
@@ -329,7 +333,6 @@ namespace TFTPServer
{
socket
=
new
Socket
(
AddressFamily
.
InterNetwork
,
SocketType
.
Dgram
,
ProtocolType
.
Udp
);
socket
.
Bind
(
iep
);
socket
.
ReceiveTimeout
=
socket_timeout
;
}
catch
(
Exception
ex
)
{
...
...
@@ -355,15 +358,6 @@ namespace TFTPServer
case
(
int
)
PACKET_TYPE
.
WRQ
:
WriteRequest
(
buffer
,
remote
);
break
;
case
(
int
)
PACKET_TYPE
.
DATA
:
DataRequest
(
buffer
);
break
;
case
(
int
)
PACKET_TYPE
.
ACK
:
AckResponse
(
buffer
);
break
;
case
(
int
)
PACKET_TYPE
.
ERROR
:
ErrorResponse
(
buffer
);
break
;
default
:
break
;
}
...
...
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