Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
file-test
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
김 민서
file-test
Commits
0334f7dd
Commit
0334f7dd
authored
6 years ago
by
김 민서
Browse files
Options
Downloads
Patches
Plain Diff
함수명 수정
parent
18b4633d
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
FileSocket/receiver.c
+9
-9
9 additions, 9 deletions
FileSocket/receiver.c
with
9 additions
and
9 deletions
FileSocket/receiver.c
+
9
−
9
View file @
0334f7dd
...
...
@@ -18,22 +18,22 @@
#include
<unistd.h>
#define BUFSIZE 1024
int
s
ocket
_o
pen
(
int
socket_fd
);
struct
sockaddr_in
s
ocket
_c
onnect
(
int
socket_fd
,
struct
sockaddr_in
server_addr
);
void
f
ile
_r
eceive
(
int
socket_fd
);
int
S
ocket
O
pen
(
int
socket_fd
);
struct
sockaddr_in
S
ocket
C
onnect
(
int
socket_fd
,
struct
sockaddr_in
server_addr
);
void
F
ile
R
eceive
(
int
socket_fd
);
void
main
()
{
int
socket_fd
;
struct
sockaddr_in
server_addr
;
socket_fd
=
s
ocket
_o
pen
(
socket_fd
);
server_addr
=
s
ocket
_c
onnect
(
socket_fd
,
server_addr
);
f
ile
_r
eceive
(
socket_fd
);
socket_fd
=
S
ocket
O
pen
(
socket_fd
);
server_addr
=
S
ocket
C
onnect
(
socket_fd
,
server_addr
);
F
ile
R
eceive
(
socket_fd
);
close
(
socket_fd
);
}
// client socket 생성
int
s
ocket
_o
pen
(
int
socket_fd
)
{
int
S
ocket
O
pen
(
int
socket_fd
)
{
if
((
socket_fd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
==
-
1
)
{
perror
(
"socket open error."
);
exit
(
1
);
...
...
@@ -42,7 +42,7 @@ int socket_open(int socket_fd) {
}
// client가 server 소켓에 연결 요청
struct
sockaddr_in
s
ocket
_c
onnect
(
int
socket_fd
,
struct
sockaddr_in
server_addr
)
{
struct
sockaddr_in
S
ocket
C
onnect
(
int
socket_fd
,
struct
sockaddr_in
server_addr
)
{
memset
(
&
server_addr
,
0
,
sizeof
(
server_addr
));
server_addr
.
sin_family
=
AF_INET
;
server_addr
.
sin_addr
.
s_addr
=
inet_addr
(
"192.168.56.101"
);
...
...
@@ -57,7 +57,7 @@ struct sockaddr_in socket_connect(int socket_fd, struct sockaddr_in server_addr)
}
// server로 부터 파일 전송 받음
void
f
ile
_r
eceive
(
int
socket_fd
)
{
void
F
ile
R
eceive
(
int
socket_fd
)
{
FILE
*
receive_fp
;
char
send_buf
[
BUFSIZE
]
=
{
'\0'
,
};
char
receive_buf
[
BUFSIZE
]
=
{
'\0'
,
};
...
...
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