Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yuesong-feng committed Jan 6, 2022
2 parents e83d811 + ec4bda6 commit d150597
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion code/day01/client.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* @Author: your name
* @Date: 2022-01-04 20:03:45
* @LastEditTime: 2022-01-05 19:08:58
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \30dayMakeCppServer\code\day01\client.cpp
*/
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
Expand All @@ -11,7 +19,7 @@ int main() {
serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");
serv_addr.sin_port = htons(8888);

bind(sockfd, (sockaddr*)&serv_addr, sizeof(serv_addr));
//bind(sockfd, (sockaddr*)&serv_addr, sizeof(serv_addr)); 客户端不进行bind操作

connect(sockfd, (sockaddr*)&serv_addr, sizeof(serv_addr));

Expand Down

0 comments on commit d150597

Please sign in to comment.