Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Fix socket example on POSIX #966

Merged
merged 3 commits into from
Oct 23, 2017
Merged

Fix socket example on POSIX #966

merged 3 commits into from
Oct 23, 2017

Conversation

olonho
Copy link
Contributor

@olonho olonho commented Oct 20, 2017

No description provided.

@olonho olonho mentioned this pull request Oct 20, 2017
Nikolay Igotti and others added 2 commits October 20, 2017 20:18
headers = stdio.h winsock.h io.h math.h
compilerOpts = -DUNICODE -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DWINAPI_FAMILY=3 \
-Wno-incompatible-pointer-types -Wno-deprecated-declarations
noStringConversion = send recv
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну да, но с другой стороны так понятнее, чего мы хотим.

@olonho
Copy link
Contributor Author

olonho commented Oct 23, 2017

klib/src/platform/windows/posix.def:35
Так мы и не меняем ничего для обычного кода, только для общего для разных платформ кода.

val serverAddr = alloc<sockaddr_in>()

val listenFd = socket(AF_INET, SOCK_STREAM, 0)
.ensureUnixCallResult { it >= 0 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сработало, я специально хотел показать разные техники.

@olonho olonho merged commit 2dde9ed into master Oct 23, 2017
@olonho olonho deleted the win_sockets branch October 23, 2017 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant